# feather : 羽毛图，绘制速度向量

theta = -pi/2:pi/16:pi/2;
r = 2*ones(size(theta));

[u,v] = pol2cart(theta,r);
feather(u,v)

# quiver : 箭头图

• 绘制速度矢量
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;

figure
quiver(x,y,u,v)

• 绘制梯度矢量
绘制函数 z=xex2y2 z = x e − x 2 − y 2 $z = xe^{-x^2-y^2}$ 的梯度
[X,Y] = meshgrid(-2:.2:2);
Z = X.*exp(-X.^2 - Y.^2);

figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off

# compass : 罗盘图

rng(0,'twister') % initialize random number generator
M = randn(20,20);
Z = eig(M);

figure
compass(Z)

# quiver3 : 3D 箭头图

[X,Y] = meshgrid(-2:0.25:2,-1:0.2:1);
Z = X.* exp(-X.^2 - Y.^2);
[U,V,W] = surfnorm(X,Y,Z);

figure
quiver3(X,Y,Z,U,V,W,0.5)

hold on
surf(X,Y,Z)
view(-35,45)
axis([-2 2 -1 1 -.6 .6])
hold off

# streamslice : 在切片平面中绘制流线图

load wind

figure
streamslice(x,y,z,u,v,w,[],[],[5])
axis tight

# streamline : 根据二维或三维向量数据绘制流线图

[x,y] = meshgrid(0:0.1:1,0:0.1:1);
u = x;
v = -y;

figure
quiver(x,y,u,v)

startx = 0.1:0.1:1;
starty = ones(size(startx));
streamline(x,y,u,v,startx,starty)


07-08

12-01
04-12 5417
12-28 2069
06-06 138
03-31 1469
08-27 6329
09-08 779
07-28 2万+