how to obtain peak time
28 views (last 30 days)
Show older comments
I have a motor response oscillating data in two columns, column 1 is time and column 2 is the response in volts. I want to develop a simple MATLAB routine to plot the data (which I have done) and find the oscillation characteristic (Peak time, overshoot %, rise time, and settling time) in the same MATLAB routine (I obtained this one too).
My problem is that I want to see the same parameters in the plot too. The system characteristic option box does not appear in the plot. what statement can I add to the existing routine to have this feature enabled. The small routine I have made is as follows:
close all
clear all
clc
fid=fopen('Exp_4_No_1_Ki_10_for_Parameters.txt','rt');
C=textscan(fid,'%f%f');
% t=fid(:,1);
% R=fid(:,1);
fclose(fid);
sys=cell2mat(C);
t=sys(:,1);
response=sys(:,2);
plot(sys(:,1:1),sys(:,2:2))
title('Response curve')
%step(sys)
% stepinfo(response,t,2.045)
S=stepinfo(response,t,2.045)
Thank you for the assistance.
0 Comments
Accepted Answer
Star Strider
on 2 Apr 2022
I am not certain what the problem is with what you want to do, however the text function could be a solution.
1 Comment
Star Strider
on 3 Apr 2022
None of the plots automatically display those.
Try something like this —
sys=tf([1 5 5],[1 1.65 5 6.5 2]);
figure
step(sys)
S=stepinfo(sys);
Sfn = fieldnames(S);
Sc = struct2cell(S);
StrS = cellfun(@(x,y)compose('%s %.4f',x,y),Sfn,Sc);
text(30,1, StrS)
figure
step(sys)
text(20,1,Sfn)
text(35,1,Sc)
.
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!