This function draws a 3D arrow using a cylinder and cone patch. This allows the use of all patch properties including transparency. It can be used with default parameters (example 1) or user-defined parameters (example 2).
> mArrow3([0 0 0],[1 1 1]);
% draws a black arrow from point [0 0 0] to point [1 1 1]
> h = mArrow3([0 0 0],[1 1 1], 'facealpha', 0.5, 'color', 'red', 'stemWidth', 0.02);
% draws a semitransparent red arrow with a stem width of 0.02 units from point [0 0 0] to point [1 1 1]; h is the handle to the patch object
Would be nice if one could fine-tune the tip width and length or tip angle. If called with output argument and without ; the return argument clutters the command window. To avoid this, and let arrow behave like plot and line, you can add at the end
if nargout == 0
It would be better if both the width and the length of the tip can be specifies. Also, it would be better if these could be specified relative to the length of the arrow.
Works great —at least for simple stuff. Haven't tried doing anything fancy with it.
suitable for plotting the coordinate axes
good program for arrows plot.
Sounds good, but not working on R2011b (188.8.131.524). No arrow, no error message.
Create scripts with code, output, and formatted text in a single executable document.