How to draw a 3D arrow/vector in MATLAB?

The function 3D arrow plot at the MATLAB file exchange actually does this:

Meanwhile https://ww2.mathworks.cn/matlabcentral/fileexchange/14056-arrow3 turned up, which might be even better but I haven't tested it...


I used something similar to your approach thta could be a start for you: here is an example of the code:

q=[0 1 0 1]; q=qnorm(q); x = q(1) / sqrt(1-q(4)*q(4))

x =

 0

y = q(2) / sqrt(1-q(4)*q(4))

y =

1.0000

z = q(3) / sqrt(1-q(4)*q(4))

z =

 0

quiver3(0, 0, 0, x, y, z)

It is a quaternion that I normalize and convert to axis components in order to draw it 3D. I also would like to be able to draw it 3D like the picture you posted.

Tags:

Matlab

Plot