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
For 3D vector
p0 = [1 2 3];
p1 = [4 5 6];
For 2D vector
p0 = [1 2];
p1 = [4 5];
Output: "Undefined function or variable"
Expect the LineWidth options
A great function!
@ Neha Singhal:
Download the function file on top right corner and then run the code.
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'.
Without shooting down your good intentions, I always use quiver3 and I'm satisfied with that.
-- Use quiver3 --
USE MATLAB'S BUILT IN "QUIVER" INSTEAD.
vectarrow has several disadvantages.
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!
The matlab built in functions quiver / quiver3 achieve the same thing plus more, e.g. plotting multiple vectors
Super! that is what i was searching for.
Thank you very much for sharing
Great work, thanks
:D you rock my world.
I love you Rentian!!! Whoo!
Superb. Exactly what I was looking for.
thank you. It helps to me.
Thanks a lot !!!!!!
did a kick ass job for plotting space cones for my orbital mechanics class
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.
2-d version works poorly when length of vector in x and y are much different, the arrowhead gets distorted.
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.
Waht is the difference between your file and those already posted in the File Exchange, especially arrow.m ?