Created
April 8, 2021 21:24
-
-
Save Luctins/bc733a6c82e70dbe449c1c6883b940d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Settle time | |
# @author: Lucas Martins Mendes - contact@luctins.me | |
function ret = settle_t(F, X = [], T = [], tolerance=0.02) | |
if size(X) == [0 0] || size(T) == [0 0] | |
[X, T] = step(F); | |
endif | |
_X = flip(X); | |
_T = flip(T); | |
s_top = (1+tolerance)*dcgain(F); | |
s_bot = (1-tolerance)*dcgain(F); | |
for i = 1:size(T)(1) | |
if X(i) < s_bot || X(i) > s_top | |
ret = T(i); | |
endif | |
endfor | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment