To be or not to be
1 次查看(过去 30 天)
显示 更早的评论
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
2019-11-15
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?
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!