To be or not to be

1 次查看(过去 30 天)
Lard Guard
Lard Guard 2018-5-3
评论: 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 个评论
Stephen23
Stephen23 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

请先登录,再进行评论。

采纳的回答

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 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by