how to plot with intervals
11 ビュー (過去 30 日間)
古いコメントを表示
I want to plot this with intervals. after taking first data sample will wait for 0.5 sec or 1 sec, then it will draw another data sample.
I used pause function. but it's not working.
schedule=repmat(10,1,5);
actual=randi(12,1,5);
if actual > schedule
battery=actual-schedule;
else
battery=schedule-actual;
end
figure(1)
plot(schedule,'r');hold on
plot(actual,'g');hold on
plot(battery,'b')
legend('schedule','actual','battery')
grid on
ylim([-15 15])
0 件のコメント
回答 (1 件)
Edoardo_a
2023 年 3 月 14 日
Hi, I used the pause option and it is working for me...maybe try to increase the timing?
schedule=repmat(10,1,5);
actual=randi(12,1,5);
if actual > schedule
battery=actual-schedule;
else
battery=schedule-actual;
end
figure(1)
plot(schedule,'r');hold on
pause(1)
plot(actual,'g');hold on
pause(1)
plot(battery,'b')
legend('schedule','actual','battery')
grid on
ylim([-15 15])
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!