单位圆向量

N=100;
for i=1:N
x=2*rand()-1;
y=2*rand()-1;
len=(x^2+y^2)^0.5;
x=x/len;
y=y/len;
hold on
quiver(0,0,x,y);
end
set(gca,'YTick',[-1:0.1:1]);
%gca表示当前的图
%
set(gca,'XTick',[-1:0.1:1]);
axis equal;

猜你喜欢

转载自blog.csdn.net/zhoutianzi12/article/details/92168847