how to use multiple graphs such as insert step and step response in a graph as shown in image?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Star Strider
2014-8-25
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 个评论
Star Strider
2014-8-25
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;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!