plot simulink in matlab

i have generated simulink figure and can convert it in matlab using plot(signal) . now if i want to take the graph between a time limit such as 0.2s t0 0.5s, which command should i write?

답변 (2개)

Andreas Goser
Andreas Goser 2013년 2월 5일

0 개 추천

There is actually no other command needed than PLOT. You only have to plot different DATA. Example:
t=0:0.001:1; % ms
data=sin(10*t); % example data
plot(t,data) % full plot
figure
plot(t(11:51),data(11:51)) % from 0.01 s to 0.05 s
cr
cr 2013년 2월 7일
편집: cr 2013년 2월 7일

0 개 추천

Well, may be you can do it. Say, tout is the vector of all time values and yout is vector of all signal values.
newtimevec = find(tout>=0.2,1):find(tout<=0.5,1,'last');
plot(tout(newtimevec), yout(newtimevec));
This should give you the plot you asked for.

카테고리

도움말 센터File Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품

태그

질문:

2013년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by