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