MATLAB: How to calculate the rotation transformation between two vectors in MATLAB 7.6 (R2008a)

3ddimensionalMATLABSimulink 3D Animationthree

I would like to calculate the four element axis-angle transformation between two vectors using a MATLAB function, instead of thethe "Rotation Between 2 Vectors" block from the Virtual Reality Toolbox.

Best Answer

The Virtual Reality Toolbox in MATLAB 7.6 (R2008a) contains a function called VRROTVEC which can be used in program files and at the Command Prompt as follows:
r = vrrotvec(a,b)
Where 'r' is the four element axis-angle transformation needed to take vector 'a' and transform it into vector 'b'.