请教各位看看我这个程序怎样就能让粒子往下走了?
function browmove(n) %n指布朗运动的点数s=0.02;%指温度或速率
%产生n个随机点(x,y),处于-0.5~0.5之间
x=randn(n,1)-0.5;
y=randn(n,1)-0.5;
z=betarnd(6,6,[1,n]);
h=plot3(x,y,z,'.');
axis([-1 1 -1 1 -1 1]);
axis square
grid on
set(h,'EraseMode','Xor','MarkerSize',20);%设置擦除模式
%循环10000次,产生动画效果
for i=1:10000
drawnow
x=x+s*rand(n,1);
y=y+s*rand(n,1);
z=z-s*betarnd(1,5,[1,n]);
set(h,'XData',x,'YData',y,'ZData',z);
pause(0.2);
end