필터 지우기
필터 지우기

how to use multiple graphs such as insert step and step response in a graph as shown in image?

조회 수: 1 (최근 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

채택된 답변

Star Strider
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
mms79
mms79 2014년 8월 25일
Thanks a lot, it work, I got exactly what required, only the thing is, now its origin is at 2, i require from 0. Regards mms79
Star Strider
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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by