how to use multiple graphs such as insert step and step response in a graph as shown in image?
2 views (last 30 days)
Show older comments
I am using this code
L=0:25;
T=[2 2.25 2.48 3.15 3.35 4.07 4.36 5.09 5.45 6.20 6.56 7.38 8.25 9.10 10.04 10.58 12.30 13.45 15.06 16.58 19.00 22.00 25.15 31.15 39.0 60.0];
plot(T,L);
grid;
Please suggest Regards MMS79
0 Comments
Accepted Answer
Star Strider
on 25 Aug 2014
It looks as though your step input plot starts at the second value of your time vector and reached a value of 20 from there on, this works:
L=0:25;
T=[2 2.25 2.48 3.15 3.35 4.07 4.36 5.09 5.45 6.20 6.56 7.38 8.25 9.10 10.04 10.58 12.30 13.45 15.06 16.58 19.00 22.00 25.15 31.15 39.0 60.0];
S = [0 ones(1,size(L,2)-1)*20];
plot(T,L);
hold on
plot(T,S, '-k', 'LineWidth',2)
hold off
grid;
2 Comments
Star Strider
on 25 Aug 2014
This seems to do what you want:
L=0:25;
T=[2 2.25 2.48 3.15 3.35 4.07 4.36 5.09 5.45 6.20 6.56 7.38 8.25 9.10 10.04 10.58 12.30 13.45 15.06 16.58 19.00 22.00 25.15 31.15 39.0 60.0];
ST = [0 linspace(0,60,size(T,2)-1)];
S = [0 ones(1,size(L,2)-1)*20];
plot(T,L);
hold on
plot(ST,S, '-k', 'LineWidth',2)
hold off
grid;
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!