MATLAB Answers

To be or not to be

7 ビュー (過去 30 日間)
Lard Guard
Lard Guard 2018 年 5 月 3 日
Commented: Rena Berman 2019 年 12 月 12 日
im trying to make a code to show the movements of particles on a graph. whenever the graph is plotted the particles dont move. How do I make the plots move over time?

  3 件のコメント

KSSV
KSSV 2018 年 5 月 3 日
I already made comments on your last question......your code need to be reconsidered......by the way your loop has only one step.
Stephen Cobeldick
Stephen Cobeldick 2019 年 11 月 15 日
Original Question by Joseph Stocken "Trying to make an animation of particle movement":
im trying to make a code to show the movements of particles on a graph. whenever the graph is plotted the particles dont move. How do I make the plots move over time?
Képkivágás.PNG
Rena Berman
Rena Berman 2019 年 12 月 12 日
(Answers Dev) Restored edit

サインイン to comment.

採用された回答

Walter Roberson
Walter Roberson 2018 年 5 月 3 日
You need to add a drawnow() or pause() after the scatter.
It is recommended that instead of using scatter() inside the loop, that instead you scatter() once before the loop and record the handle that is returned. Then inside the loop, set() the XData and YData properties of the handle to reflect the new locations: that is more efficient than rebuilding the axes each time the way you are now.

  0 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。

タグ

タグが未入力です。


Translated by