MATLAB画向量图

二维向量画图使用函数quiver。

帮助

quiver(X,Y,U,V) plots velocity vectors as arrows with components (u,v)  at the points (x,y).  The matrices X,Y,U,V must all be the same size  and contain corresponding position and velocity components (X and Y  can also be vectors to specify a uniform grid).  quiver automatically  scales the arrows to fit within the grid.

X 和 Y 组成网格,分别包括网格的横坐标和纵坐标。

code:

N = 2;
h = quiver([0,1],[0,2], randn(N), randn(N));

MATLAB画向量图_第1张图片


你可能感兴趣的:(matlab)