Code covered by the BSD License  

Highlights from
Plot 3d vectors

5.0

5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 27.3 KB File ID: #29490
image thumbnail

Plot 3d vectors

by Pirmin Borer

 

22 Nov 2010

Plot real 3d arrows from .stl file. Similar to quiver

| Watch this File

File Information
Description

h=vector3d(X,Y,Z,U,V,W,'Property','Value',...)

 Plot 3d vectors (real 3d) from .stl file to specified location and direction.

basically same usage as quiver3. Property/value pairs are passed to patch.
Some additional property/values are available:

h=vector3d(...,'FileName',file) : string arry with name of .stl file (for example 'arrow4.stl').

h=vector3d(...,'Scale',[sx sy sz]) : scales along the x-axis by sx, along the y-axis by sy, and along the z-axis by sz. If scalar, Vectors are scaled uniformly.

h=vector3d(...,'MaxVert',nmax) : Maximum number of vertices per vector. Lower this value if many vectors have to be plotted. Default is 200.

h=vector3d(...,'Lighting','gouraud') : Sets both, edge and face lighting. Default is flat lighting
h=vector3d(...,'Color',rgb) : Sets face and edge color to specified color (indexed or true rgb). When omitted the vector length and current colormap are used.

h=vector3d(...,'ColorMap',cmap) : sets the colormap to cmap for plotting. Minimum (but non-zero) and maximum data are mapped to the interval [0 1].

h=vector3d(...,'LightDirection',[x y z]) : Adds a infinite light to the axes with specified position [x y z]

Example:

[X,Y,Z]=sphere(20);
[U,V,W] = surfnorm(X,Y,Z);
surf(X,Y,Z);
hold on
h=vector3d(X,Y,Z,U,V,W,'FileName','arrow2.stl','Scale',0.25,'Lighting',...
'gouraud','ColorMap','jet','LightDirection',[-1 -1 1])

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
3d vector, quiver 3d, quiver3, quiver3d, vector, vector plot(2)
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
09 Apr 2012 Mr Smart  

Contact us