- 'stepinfo' function: https://www.mathworks.com/help/control/ref/dynamicsystem.stepinfo.html
how can I get overshoot, rise time, settling time... from an output?
조회 수: 10 (최근 30일)
이전 댓글 표시
I use simulink to get an output,and I want to get overshoot,rise time,settling time...like that overshoot=... rise time=xxx second, settling time=xxx second.Then I want to make a function: f=A*overshoot+B*rise time+C*settling time
댓글 수: 0
답변 (1개)
Balavignesh
2024년 1월 15일
Hi Ys,
After simulating the system in Simulink and obtaining the output signal, make sure to log the output to the MATLAB workspace for analysis, You could use MATLAB functions like 'stepinfo' to get overshoot, rise time, and settling time. After getting the necessary values, create a MATLAB function to calculate the weighted sum of these characteristics.
The following example code snippet may help you understand this concept:
% Assume 'simOut' is the variable containing the simulation output, with the signal of interest logged as 'yout'
% You can log signals to the workspace by using To Workspace blocks or signal logging
% Extract the output signal and time vector
t = simOut.yout.Time;
y = simOut.yout.Data;
% Extract the characteristics
overshoot = responseInfo.Overshoot;
riseTime = responseInfo.RiseTime;
settlingTime = responseInfo.SettlingTime;
% Display the characteristics
fprintf('Overshoot = %.2f%%\n', overshoot);
fprintf('Rise Time = %.4f second\n', riseTime);
fprintf('Settling Time = %.4f second\n', settlingTime);
% Define the weighted sum function
weightedSumFunction = @(A, B, C) A*overshoot + B*riseTime + C*settlingTime;
% Example usage of the weighted sum function with weights A, B, and C
A = 1; % Example weight for overshoot
B = 1; % Example weight for rise time
C = 1; % Example weight for settling time
weightedSum = weightedSumFunction(A, B, C);
% Display the weighted sum
fprintf('Weighted Sum = %.4f\n', weightedSum);
Kindly have a look at the following documentation link to have more information on:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!