clc;
clear;
t=0:0.01:4*pi;
y=sin(t);x=cos(t);
plot(x,y);axis equal;axis off;
h=line('color','r','linestyle','.','xdata',0,'ydata',1,'markersize',50,'erasemode','xor');
i=1;
n=length(t);
while 1
set(h,'xdata',x(i),'ydata',y(i));
drawnow
pause(0.01)
i=i+1;
if i>n
i=1;
end
end