No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
3D Arrow with many color/parameter options

4.6 | 6 ratings Rate this file 14 Downloads (last 30 days) File Size: 77.5 KB File ID: #12274 Version: 1.0
image thumbnail

3D Arrow with many color/parameter options



14 Sep 2006 (Updated )

Create a single 3D arrow in a volumized format

| Watch this File

File Information

This code allows you to create simple, yet powerful three dimensional arrow. As it is derived from the surf command, it may be memory intensive, but well worth the cost for crisp visualization of data using phong shading and MATLAB's lighting options.

arrow3D([0,0,0], [0,0,1],'red',0.82);

%% Creates a single arrow starting at the origin with magnitude=1 along the z-axis, in red, with an arrowhead 18% of the length and the stem 82% of the length.
This has a 'published' file, so use:
  playshow demoArrow3D

to view many of the details or simply view directly the html file attached.


This file inspired The Code For Solving Wahba's Problem and Plot A Plane Or Line In 3 D.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
20 Aug 2013 Michael Wang

There is a bug on line 71. It should be:

Otherwise, the base radius of the cone does not vary with the 'coneRadius' parameter above.

Also, it should be sufficient to use

incr = 1

on line 69

Thanks for the useful function

05 Mar 2012 Jun Liu

15 Oct 2009 Josh

Josh (view profile)

05 Dec 2008 Maria

Maria (view profile)

Works fine. Although I would like to have more info/help.

18 Sep 2006 John D'Errico

Nicely improved. This now deserves a 5 rating.

15 Sep 2006 John D'Errico

Nice arrows. My only comment is that I'd prefer to see only two inputs, as vectors instead of 6 inputs. Thus you would call it as


This would seem generally easier to use programmatically, since most of the time this information is already in one vector anyway. For multiple arrows, supply an array.

Its a minor point, and purely style, so I'd otherwise leave my rating as a 5. I chose to downrate this to a 4 because the author forgot to include the meanings of the parameters in the help for this function. Yes, the demo file is very nice, and I like to see examples. But next year or next month when I want to use this code, I'll need to get help for it in matlab. This help is useless. Are Qx,Qy,Qz the end points of the arrow or the delta in each dimension? What are the explicit meanings for colorCode and stemRatio?

I actually wanted to rate this lower because of the poor included help, but I liked it enough to leave it as a 4. I'll hope the author chooses to upgrade the help. I'd also love to see a better H1 line. As it is, the function lookfor will never see this function, so next year when you want to use this code, you may not even find it anyway.

Contact us