0
$\begingroup$

I would like to compute the settling time of a signal y in Matlab. It should give the amount of time required before the signal reaches a steady state error $|y(t)-y_{ss}|$ which is smaller than some absolute value x and stays smaller than x for all future times.

I already tried to use the Matlab function stepinfo, but this defines the value x as "a fraction 2% of their peak value for all future times" and that is not what i want.

Is there a way that i could determine this analytically, so i could code it myself in Matlab?

1 Answers 1

0

You could evaluate $|y(t)-y_{ss}|>x$ and check for the last index, where this evaluation is true. This is quite easy by using the max-command.

  • 0
    thank you, it is so simple though i was searching for it so long.. i suppose i can evaluate the error by using the command find(error>x)?2017-01-14
  • 0
    if you think your code might be inefficient post it, i might be able to help you optimize it using matlab built-in functions only.2017-01-14
  • 0
    this is how i have code it, i think it's right: St = tspan(find(error>x, 1, 'last' )); instead of using 'max', matlab made a suggestion to use the option 'last' for the find command. error = abs(y(:,1)-y1_ss)2017-01-15