1DのN点の動きをアニメーション化しました。問題は、以前のプロットを取り除き、動きで作成されたトラックを削除する方法を見つけることができないということです。Nポイントmatlabアニメーションのトラックを削除するには
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
あなたがそれを指摘いただきありがとうございます@EBHアニメーション – EBH
としてこれを見たい場合は、ループ内で一時停止を置く必要があります。私はOPのコードで直接編集し、間違った「終わり」を削除しました。今修正されました。 –