CodePudding user response:
X=linspace (0,10,1000);Y=sin (x);
The plot (x, y) % sine curve first
Hold on
H=the plot (x (1), y (1), 'o', 'MarkerFaceColor', 'red'). % draw point
Hold off
The axis manual
J=1;
While j> 0
For k=1: length (x)
h.XData=https://bbs.csdn.net/topics/x (k); % with handle change point data, is handle animation
h.YData=https://bbs.csdn.net/topics/y (k);
Drawnow
End
J=1
end