num = [100]; den = [1 12 100]; sys = tf(num, den); info = stepinfo(sys); peak_time = info.PeakTime;
Peak time is the time at which the response reaches its first maximum peak.
Using the stepinfo function in Simulink or MATLAB, the peak time for this system is approximately 0.4 seconds.
num = [1]; den = [1 3 2]; sys = tf(num, den); info = stepinfo(sys);
MATLAB is case-sensitive and uses exact field names in structures.
The correct field name in the stepinfo output is 'SettlingTime' with capital S and T.
Think about what information a step response plot shows and what it does not.
The step response plot shows time-domain behavior like rise time, overshoot, and steady-state error, but it does not reveal the system order directly.
Recall how damping affects oscillations and speed of settling.
Higher damping reduces overshoot but typically causes the system to settle more slowly, increasing settling time.
num = [10]; den = [1 2]; sys = tf(num, den); info = stepinfo(sys); peak_time = info.PeakTime; disp(peak_time);
Check the system stability and stepinfo requirements.
The code produces no error. The first-order stable system has no overshoot, so stepinfo returns NaN for PeakTime, and disp(peak_time) outputs 'NaN'.
