Plot 3d vectors
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])
Citar como
Pirmin Borer (2025). Plot 3d vectors (https://www.mathworks.com/matlabcentral/fileexchange/29490-plot-3d-vectors), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
- MATLAB > Graphics > 2-D and 3-D Plots > Vector Fields >
- MATLAB > Graphics > Labels and Styling > Interactions, Camera Views, and Lighting > Lighting, Transparency, and Shading >
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.0.0.0 |