how to apply stepinfo command correctly
30 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposte (1)
Shlok
il 16 Set 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:
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!