アニメーションの速度の制御について
Mostrar comentarios más antiguos
下記リンクを参考にグラフ描画をアニメーションで指定した更新頻度で実行したいのですが上手くいきません。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 comentarios
animated lineをGIFで保存して、その時のdelay timeを調整したら、望む形のインターバルになりませんかね。上のURLのGIFの欄、お役に立てば嬉しいです。
denpika
el 13 de Jul. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre グラフィックス パフォーマンス en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!