MATLAB: How to plot a line that has an arrow on the end of it, in 2-D and 3-D

2-d2d3-d3darrowdwhhglineMATLABplot

I would like to have an example that shows how to draw objects with the LINE command.

Best Answer

There are two files (arrow.m and arrow3.m) that will plot a line with an arrow on the end of it. These files are available on MATLAB Central:
To find these MATLAB files, type their respective names in the Search field.
You may also be interested in the QUIVER and QUIVER3 commands. These functions create 2D and 3D quiver plots. For more information on this function, type:
help quiver
help quiver3
at the MATLAB Command Prompt. If you have installed the documentation, type
doc quiver
doc quiver3
to see the documentation for this function. If you do not have the documentation installed, you can find it here: