注册 登录
编程论坛 Matlab

[求助]set(h,'XData','x','YData','y')出错

zxye 发布于 2007-06-02 15:21, 1660 次点击

程序如下,
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')
请高手指教!

2 回复
#2
zhangenter2007-06-02 17:51
set(h,'XData',x,'YData',y)
#3
leki2007-06-03 23:41


while 1
。。。
end
这是个 死循环,应该注意一下

1