matlab quiver线,quiver -- 画箭头matlab命令

quiver - Quiver or velocity

plot

a4c26d1e5885305701be709a3d33442f.png

GUI Alternatives

To graph selected variables, use the Plot Selector a4c26d1e5885305701be709a3d33442f.png in the Workspace Browser, or use the Figure

Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor.

For details, see Plotting Tools — Interactive Plotting in the MATLAB Graphics

documentation and Creating Graphics from the Workspace Browser in the MATLAB

Desktop Tools documentation.

Syntax

quiver(x,y,u,v)

quiver(u,v)

quiver(...,scale)

quiver(...,LineSpec)

quiver(...,LineSpec,'filled')

quiver(axes_handle,...)

h = quiver(...)

hlines = quiver('v6',...)

Description

A quiver plot displays velocity vectors as arrows with

components (u,v) at the points (x,y).

For example, the first vector is defined by components

u(1),v(1) and is displayed at the point

x(1),y(1).

quiver(x,y,u,v) plots vectors

as arrows at the coordinates specified in each corresponding pair

of elements in x and y. The matrices x,

y, u, and v must all be the same size

and contain corresponding position and velocity components.

However, x and y can also be vectors, as

explained in the next section. By default, the arrows are scaled to

just not overlap, but you can scale them to be longer or shorter if

you want.

Expanding x- and y-Coordinates

MATLAB expands x and y if they are not

matrices. This expansion is equivalent to calling meshgrid to generate matrices from vectors:

[x,y] = meshgrid(x,y);

quiver(x,y,u,v)

In this case, the following must be true:

length(x) = n and length(y)

= m, where [m,n] =

size(u) = size(v).

The vector x corresponds to the columns of u

and v, and vector y corresponds to the rows of

u and v.

quiver(u,v) draws vectors

specified by u and v at equally spaced points in

the x-y plane.

quiver(...,scale)

automatically scales the arrows to fit within the grid and then

stretches them by the factor scale. scale

= 2 doubles their relative length, and

scale = 0.5 halves the length. Use

scale = 0 to plot the velocity vectors without automatic

scaling. You can also tune the length of arrows after they have

been drawn by choosing the Plot Edit a4c26d1e5885305701be709a3d33442f.png tool, selecting the quivergroup

object, opening the Property Editor, and adjusting the

Length slider.

quiver(...,LineSpec) specifies

line style, marker symbol, and color using any valid

LineSpec. quiver draws the markers at the origin

of the vectors.

quiver(...,LineSpec,'filled')

fills markers specified by LineSpec.

quiver(axes_handle,...) plots

into the axes with the handle axes_handle instead of into

the current axes (gca).

h = quiver(...) returns the

handle to the quivergroup object.

Backward-Compatible Version

hlines = quiver('v6',...)

returns the handles of line objects instead of quivergroup objects

for compatibility with MATLAB 6.5 and earlier.

Note The v6

option enables users of Version 7.x of MATLAB to create FIG-files

that previous versions can open. It is obsolete and will be removed

in a future version of MATLAB.

Examples

Showing the Gradient with Quiver Plots

Plot the gradient field of the function a4c26d1e5885305701be709a3d33442f.png:

[X,Y] = meshgrid(-2:.2:2);

Z = X.*exp(-X.^2 - Y.^2);

[DX,DY] = gradient(Z,.2,.2);

contour(X,Y,Z)

hold on

quiver(X,Y,DX,DY)

colormap hsv

hold off

a4c26d1e5885305701be709a3d33442f.png

See Also

Quivergroup Properties for property descriptions

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值