[求助]set(h,'XData','x','YData','y')出错
程序如下,
n=20;
s=0.02;
x=rand(n,1)-0.5;
y=rand(n,1)-0.5;
h=plot(x,y,'.');
axis([-1 1 -1 1])
axis square
grid off
set(h,'erasemode','xor','markersize',18);
while 1
drawnow
x=x+s*randn(n,1)
y=y+s*randn(n,1)
set(h,'XData','x','YData','y')
end
运行时显示错误
??? Error using ==> set
Value must be numeric.
Error in ==> practiceofmovie at 14
set(h,'XData','x','YData','y')
请高手指教!