I'd like to commend you for a powerful set of scripts. I learned a lot by running the demo and changing the parameters. Great contribution.
Is there a way for me to use your code to simulate a wobbling rigid body? I think about the out-of-balance case like an unbalanced tire rotating in space.
This is great stuff. Concise and functional. However, I have a problem with function 'unitvector'. It is used in several places in the code but it is nowhere to be seen. Here's an example error message when trying to use 'OmegaAxis':
1492 [axis, omega] = unitvector( omegav, 1 );
Undefined function 'unitvector' for input arguments of type 'double'.
Error in quaternion/OmegaAxis (line 1492)
[axis, omega] = unitvector( omegav, 1 );