MATLAB 的一个小时钟问题

脚本如下:

t= 0 : pi/50 : 2*pi;
x=cos(t);
y=sin(t);
plot(x,y);
hold on;
axis equal;%使横纵坐标量程相等

LineX=[0,1];%在圆的坐标上画一条直线,两点坐标是(0,0)与(1,0)
LineY=[0,0];%所以x取值是(0,1),y的取值是(0,0)
h=plot(LineX,LineY);
theta=0;
while true
    theta=theta+pi/50;
    LineX(2)=cos(theta);%X(2)和Y(2)都是表示改变的是第二个数值
    LineY(2)=sin(theta);
    set(h,'XDate',LineX,'YData',LineY);
    drawnow;
end

出错在set这个地方,望解答!!谢谢!!