No BSD License  

Highlights from
Plot 2D/3D Vector with Arrow

3.74194

3.7 | 31 ratings Rate this file 232 Downloads (last 30 days) File Size: 2.52 KB File ID: #7470
image thumbnail

Plot 2D/3D Vector with Arrow

by Rentian Xiong

 

18 Apr 2005 (Updated 20 Apr 2005)

This function plots a line vector with arrow head.

| Watch this File

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)

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (35)
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 ?

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.

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.

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.

30 Nov 2005 Justin Maneely

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

22 Mar 2006 Anhe Le

useless

14 Feb 2007 Ronny Meza  
17 Apr 2007 A A

Thanks a lot !!!!!!

27 Apr 2007 Levent K

thank you. It helps to me.

27 May 2007 sang jun  
19 Jun 2007 Asif Sheikh  
09 Jul 2007 Cornelius Steinhardt  
16 Oct 2007 Elane Phoenix

Superb. Exactly what I was looking for.

08 Nov 2007 Mary Amon

I love you Rentian!!! Whoo!

08 Nov 2007 Audrey Fan

:D you rock my world.

09 Nov 2007 q q  
08 Dec 2007 Dayu Lv

Great work, thanks

22 Jan 2008 s p

Great!!

22 Feb 2008 LC Nguyen

Thank you very much for sharing

01 Mar 2008 fgfg gdsfgdfg  
14 Apr 2008 stef Keh  
17 Apr 2008 Cai Cai

Super! that is what i was searching for.

18 Apr 2008 d s

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

02 Sep 2008 yehua wei

very goog,thanks

02 Sep 2008 Adam Ufford  
15 Oct 2008 thong kieu  
21 Oct 2008 p lks  
21 Oct 2008 Mehmet Ozerdem  
05 Feb 2010 Cesar Chillon  
07 Oct 2010 Gautam Sethi

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!

24 Feb 2011 S

USE MATLAB'S BUILT IN "QUIVER" INSTEAD.

vectarrow has several disadvantages.

05 Jul 2011 Floris

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

-- Use quiver3 --

07 Aug 2011 Neha Singhal

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....

09 Jan 2012 Pratul

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

22 Jan 2012 Pablo  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
2d Rentian Xiong 22 Oct 2008 07:46:07
3d Rentian Xiong 22 Oct 2008 07:46:07
vector Rentian Xiong 22 Oct 2008 07:46:07
arrow Rentian Xiong 22 Oct 2008 07:46:07
mathematics Rentian Xiong 22 Oct 2008 07:46:07
plot Rentian Xiong 22 Oct 2008 07:46:07
2d Ray Fang 10 Sep 2009 04:48:04
3d Ray Fang 10 Sep 2009 04:48:12
plot Ray Fang 10 Sep 2009 04:48:13
vector plot Ray Fang 10 Sep 2009 04:48:28
3d plot Ray Fang 10 Sep 2009 04:48:45
arrow Tsutomu 10 Nov 2009 08:12:41
vector Munipalle 27 Mar 2010 05:17:05
3d plot lavanya indira 21 May 2010 06:36:51
vector plot Didace EKEOM 17 Jun 2010 09:01:53
3d Didace EKEOM 17 Jun 2010 09:02:00
3d plot Nishad Patil 21 Jun 2010 08:08:55
arrow kuoping 29 Jun 2010 07:05:25
plot kuoping 29 Jun 2010 07:05:27
vector kuoping 29 Jun 2010 07:05:29
arrow Mariano 08 Jul 2010 04:47:04
vector Chin Chieh 04 Oct 2010 17:40:21
3d Prayag 26 Oct 2010 04:25:57
3d Ricardo Abdoel 03 Nov 2010 18:08:28
vector plot Lars Roepstorff 11 Jan 2011 17:20:40
arrow Chad Lieberman 30 Jan 2011 00:16:23
arrowm Jimbo 11 Aug 2011 02:15:12
2d William 29 Aug 2011 22:30:00
arrowm oskimo 12 Sep 2011 07:50:35
2d Jaya KP 14 Sep 2011 08:03:47
arrow changxu changxu 04 Oct 2011 11:08:11
arrowm changxu changxu 04 Oct 2011 11:08:14
arrowm Wilbert van Ham 07 Nov 2011 02:23:39
plot Johanna 17 Nov 2011 07:47:44
arrow Seth DeLand 09 Dec 2011 14:48:15
arrow Michael Hansen 30 Dec 2011 10:50:17

Contact us at files@mathworks.com