【发布时间】:2016-08-17 18:32:20
【问题描述】:
我已经在 1D 中为 N 个点的运动设置了动画。问题是我无法找到摆脱之前的情节并移除运动中创建的轨迹的方法。
function sol=Draw(N)
%N is the number of points
PointsPos=1:N
for s=1:1000
for i=1:N
PointsPos(i)=PointsPos(i)+ rand(1,1)
%The position of the point is increased.
end
for i=1:N
%loop to draw the points after changing their positions
hold on
plot(PointsPos,1,'.')
end
pause(0.005)
%here I want to delete the plots of the previous frame s
end
end
【问题讨论】:
标签: matlab animation plot matlab-figure