how to apply stepinfo command correctly

30 views (last 30 days)
Shymaa Nasser
Shymaa Nasser on 18 Jan 2022
Answered: Shlok on 16 Sep 2024
i have a curve based on a step input using simulink the step starts at t=1 second and before this time there a intial values
i save the data given from simulink as an array
my question is how to apply stepinfo correctly to measur settling time ,overshoot,rise time or there another accurate method
thanks in advance

Answers (1)

Shlok
Shlok on 16 Sep 2024
Hi Shymaa,
To apply the “stepinfo” function correctly using your Simulink array data, you can extract the time and output data from the simulation, then adjust for any initial conditions before the step input (starting at 1 second in your case).
After cropping the data from the point where the step input begins, you can use “stepinfo” to measure key parameters like settling time, overshoot, and rise time. Here’s a small code snippet for the same:
% Assuming out stores Simulink data
time = out.tout; % Time array
output = out.sim_output; % Response array
% Crop the data starting from the step input time
step_start_time = 1;
cropped_time = time(time >= step_start_time);
cropped_output = output(time >= step_start_time);
S = stepinfo(cropped_output, cropped_time);
fprintf('Rise Time: %.2f seconds\n', S.RiseTime);
fprintf('Settling Time: %.2f seconds\n', S.SettlingTime);
fprintf('Overshoot: %.2f%%\n', S.Overshoot);
fprintf('Peak Time: %.2f seconds\n', S.PeakTime);
To know more about “stepinfo” function, you can refer to the following documentation link:

Categories

Find more on Modeling in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!