アニメーションの速度の制御について
Show older comments
下記リンクを参考にグラフ描画をアニメーションで指定した更新頻度で実行したいのですが上手くいきません。https://jp.mathworks.com/help/matlab/ref/animatedline.html
例えば、下記コードのようにT(0.02s)で計測したデータを
計測時間と同じように更新し12.56s(総計測時間)で再生を終えるようにしたいですが、
場合だと一瞬で描画が終わってしまいます。
また、再生時間を倍速(×0.5 ×2)する方法も教えていただきたく。
T = 1/50; % sampling rate 0.02s
h = animatedline;
axis([0,4*pi,-1,1])
x = 0:T:pi*4;
y = sin(x);
a = tic; % start timer
for k = 1:length(x)
addpoints(h,x(k),y(k))
b = toc(a); % check timer
if b > T
drawnow % update screen every T seconds
a = tic; % reset timer after updating
end
end
drawnow % draw final frame
2 Comments
animated lineをGIFで保存して、その時のdelay timeを調整したら、望む形のインターバルになりませんかね。上のURLのGIFの欄、お役に立てば嬉しいです。
denpika
on 13 Jul 2020
Accepted Answer
More Answers (0)
Categories
Find more on グラフィックス パフォーマンス 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!