Skip to content

Instantly share code, notes, and snippets.

@Luctins
Created April 8, 2021 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luctins/bc733a6c82e70dbe449c1c6883b940d0 to your computer and use it in GitHub Desktop.
Save Luctins/bc733a6c82e70dbe449c1c6883b940d0 to your computer and use it in GitHub Desktop.
# 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