How to create a trajectory animation?

조회 수: 2 (최근 30일)
Enrique Rondán
Enrique Rondán 2018년 1월 9일
How can i create an animation where i represent the trajectory of a point with 200 points, for example, and from there, by each point of the trajectory that is aggregated, i clear the first drawn point. So that it always has the same represented numbers of points in the figure. The code is the following:
imax=size(TrompoX, 2);
iframe=1;
irep=200;
size_mov=floor(imax/10);
movimiento = struct('cdata', cell(1,size_mov), 'colormap', cell(1,size_mov));
for ii=0:201:floor(imax)
clf
for jj=1:irep
plot(TrompoX(ii+jj), TrompoY(ii+jj),'*r')
hold on
axis([150 300 150 300])
movimiento(iframe)=getframe;
iframe=iframe+1;
end
end
But with this what i've achieved is to represent until 200 points and after that it deletes everything and keeps drawing the following 200 points and deletes everything again until there aren't more points.
Thanks a lot in advance for your help.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by