how to apply stepinfo command correctly

32 ビュー (過去 30 日間)
Shymaa Nasser
Shymaa Nasser 2022 年 1 月 18 日
回答済み: Shlok 2024 年 9 月 16 日
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

回答 (1 件)

Shlok
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:

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by