【源码】MATLAB绘制各类箭头标志的函数arrow

在这里插入图片描述
arrow函数的作用是绘制一条带箭头的直线,该函数包括的箭头类型远比MATLAB自带的箭头功能强大。

举例:

arrow([1 2 3],[0 0 0],36,‘BaseAngle’,60)

该函数的直线起点为[1 2 3],终点为[0 0 0],箭头长度占据36个像素,夹角BaseAngle为60度,关于箭头参数的示意如下图所示。

MATLAB部分源码如下:

function [h,yy,zz] = arrow(varargin)

% ARROW Draw a line with an arrowhead.

%

% ARROW(Start,Stop) draws a line with an arrow from Start to Stop (points

% should be vectors of length 2 or 3, or matrices with 2 or 3

% columns), and returns the graphics handle of the arrow(s).

%

% ARROW uses the mouse (click-drag) to create an arrow.

%

% ARROW DEMO & ARROW DEMO2 show 3-D & 2-D demos of the capabilities of ARROW.

%

% ARROW may be called with a normal argument list or a property-based list.

% ARROW(Start,Stop,Length,BaseAngle,TipAngle,Width,Page,CrossDir) is

% the full normal argument list, where all but the Start and Stop

% points are optional. If you need to specify a later argument (e.g.,

% Page) but want default values of earlier ones (e.g., TipAngle),

% pass an empty matrix for the earlier ones (e.g., TipAngle=[]).

%

% ARROW(‘Property1’,PropVal1,‘Property2’,PropVal2,…) creates arrows with the

% given properties, using default values for any unspecified or given as

% ‘default’ or NaN. Some properties used for line and patch objects are

% used in a modified fashion, others are passed directly to LINE, PATCH,

% or SET. For a detailed properties explanation, call ARROW PROPERTIES.

下载完整源代码地址:

http://page2.dfpan.com/fs/6lbc9j72b2515209160/

更多精彩文章请关注微信号:在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值