how to apply stepinfo command correctly
30 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Shlok
2024-9-16
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 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!