### Highlights from Plot 2D/3D Vector with Arrow

3.825
3.8 | 40 ratings Rate this file 92 Downloads (last 30 days) File Size: 2.52 KB File ID: #7470 Version: 1.0

# Plot 2D/3D Vector with Arrow

### Rentian Xiong (view profile)

18 Apr 2005 (Updated )

This function plots a line vector with arrow head.

File Information
Description

Arrowline 3-D vector plot.

vectarrow(p0,p1) plots a line vector with arrow pointing from point p0 to point p1. The function can plot both 2D and 3D vector with arrow depending on the dimension of the input

Example:
For 3D vector
p0 = [1 2 3];
p1 = [4 5 6];
vectarrow(p0,p1)

For 2D vector
p0 = [1 2];
p1 = [4 5];
vectarrow(p0,p1)

Acknowledgements

This file inspired Calculation Of Forces Of A Pile System.

MATLAB release MATLAB 6.5 (R13)
11 Jul 2016 Diego Quiroga

### Diego Quiroga (view profile)

useful :)

Comment only
12 Mar 2016 Justin Chu

### Justin Chu (view profile)

08 Sep 2015 Guillermo Berrios

### Guillermo Berrios (view profile)

23 Aug 2015 Jianchao Li

### Jianchao Li (view profile)

Mark.

04 Nov 2014 Ítalo Pedrosa

### Ítalo Pedrosa (view profile)

Expect the LineWidth options
Great Job

25 Mar 2014 Chou

### Chou (view profile)

A great function!

08 May 2013 icarli

20 Jun 2012 wong

25 May 2012 Ken

### Ken (view profile)

22 Jan 2012 Pablo

### Pablo (view profile)

09 Jan 2012 Pratul

### Pratul (view profile)

@ Neha Singhal:
Download the function file on top right corner and then run the code.

07 Aug 2011 Neha Singhal

### Neha Singhal (view profile)

I tried used the function vectarrow as suggested here, but I am getting an error message saying:

??? Undefined function or method 'vectarrow' for input arguments of type 'double'.

Pls help....

Comment only
05 Jul 2011 Floris

### Floris (view profile)

Without shooting down your good intentions, I always use quiver3 and I'm satisfied with that.

-- Use quiver3 --

24 Feb 2011 S

### S (view profile)

USE MATLAB'S BUILT IN "QUIVER" INSTEAD.

07 Oct 2010 Gautam Sethi

### Gautam Sethi (view profile)

This is life saver! I was looking for something simple like this; surprisingly, MATLAB doesn't have a built in function that does the job. Thank you for creating this function!

05 Feb 2010 Cesar Chillon

### Cesar Chillon (view profile)

21 Oct 2008 Mehmet Ozerdem
21 Oct 2008 p lks
15 Oct 2008 thong kieu
02 Sep 2008 yehua wei

very goog,thanks

18 Apr 2008 d s

The matlab built in functions quiver / quiver3 achieve the same thing plus more, e.g. plotting multiple vectors

Comment only
17 Apr 2008 Cai Cai

Super! that is what i was searching for.

14 Apr 2008 stef Keh
01 Mar 2008 fgfg gdsfgdfg
22 Feb 2008 LC Nguyen

Thank you very much for sharing

22 Jan 2008 s p

Great!!

08 Dec 2007 Dayu Lv

Great work, thanks

09 Nov 2007 q q
08 Nov 2007 Audrey Fan

:D you rock my world.

08 Nov 2007 Mary Amon

I love you Rentian!!! Whoo!

16 Oct 2007 Elane Phoenix

Superb. Exactly what I was looking for.

09 Jul 2007 Cornelius Steinhardt
19 Jun 2007 Asif Sheikh
27 May 2007 sang jun
27 Apr 2007 Levent K

thank you. It helps to me.

17 Apr 2007 A A

Thanks a lot !!!!!!

14 Feb 2007 Ronny Meza
22 Mar 2006 Anhe Le

useless

30 Nov 2005 Justin Maneely

did a kick ass job for plotting space cones for my orbital mechanics class

14 Nov 2005 J. Willard Gibbs

Not very useful unless you can plot multiple vectors. The function does not cycle through plot colors, so each call plots the vector the same color, which gets hard to tell what is going on.

Easy fix-up: allow an optional color token in the pass variable list.

29 Oct 2005 Charles Warren

2-d version works poorly when length of vector in x and y are much different, the arrowhead gets distorted.

21 Apr 2005 Rentian Xiong

Oh, sorry for my ignorance. I did not search for those functions. I wrote this one simply because someone asked for help on matlab central.

Comment only
21 Apr 2005 Jérôme MyLastName

Waht is the difference between your file and those already posted in the File Exchange, especially arrow.m ?

Comment only