Animation in Matlab using animatedline command

1 回表示 (過去 30 日間)
Arvind Kumar Pathak
Arvind Kumar Pathak 2017 年 7 月 28 日
コメント済み: Star Strider 2017 年 7 月 28 日
I have this animation code
curve = animatedline('Color','b','LineWidth',1); % clearpoints(curve) axis([-15,15,-15,20]); for i=1:length(t) for j = statesp1+1:3:a addpoints(curve,x(i,j), x(i,j+1), x(i,j+2)); end drawnow;
clearpoints(curve)
pause(0.001);
for j = 1:3:statesp1
addpoints(curve,x(i,j), x(i,j+1), x(i,j+2));
end
drawnow;
clearpoints(curve)
% pause (0.0005);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Results for this cose is attached. just load the results in workspace and run the code. During animation, it is blinking. can someone help me to remoce that blinking part. thanks

回答 (1 件)

Star Strider
Star Strider 2017 年 7 月 28 日
The clearpoints calls cause the blinking.
I am not certain what you want to do. However it might be better to re-design your code without using animatedline objects.
It is only necessary to load these variables, rather than all in the file:
D = load('res.mat');
x = D.x;
t = D.t;
statesp1 = D.statesp1;
a = D.a;
  2 件のコメント
Arvind Kumar Pathak
Arvind Kumar Pathak 2017 年 7 月 28 日
i am able to understand the last line. can you tell me about that
Star Strider
Star Strider 2017 年 7 月 28 日
Please be a bit more specific. What are you referring to?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by