Plot Unit Vectors

版本 1.0.0.0 (1.8 KB) 作者: James West
Simple method to plot unit vectors in 3d
716.0 次下载
更新时间 2010/8/31

查看许可证

This function plots unitvectors X Y and Z or (e1, e2, e3) from an origin.
This function is fairly robust in that it can take 2 types of input. It can take a transformation matrix of the form
trMatrix = [1 0 0 0; pos' unitx' unity' unitz'] as:
fcn_plotUnitVectors(trMatrix).

Or it can take it as a combination of [1x3] vectors as:
fcn_plotUnitVectors(origin[1x3], csX[1x3], csY[1x3], csZ[1x3], vectorScale[1x1],colorSel)
colorSel can be a string used to format the vector as well.

The default coloring is
unit1 - red, unit2 - green, unit3 - blue

You can also set your own linestyles, for example:
if you have colorSel = ['''k'', ''LineWidth'', 5'] as the input, it will set the color to black and the thickness of the line to 5

Use: Easiest use is fcn_plotUnitVectors(trMatrix), however the vectorScale is not dynamic so it will need to be changed in the code if it doesn't suit your data.

引用格式

James West (2024). Plot Unit Vectors (https://www.mathworks.com/matlabcentral/fileexchange/28608-plot-unit-vectors), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0