How to multiply quaternions with symbols

3 visualizaciones (últimos 30 días)
Chamira Wickramasinghe
Chamira Wickramasinghe el 8 de Ag. de 2017
Respondida: Chamira Wickramasinghe el 9 de Ag. de 2017
Hi,
I'm trying to multiply two quaternions with 'quatmultiply'.
But one quaternion contains symbols. So matlab gives an error saying "Error using quatmultiply (line 48) Second input elements are not real."
Below is the code I used,
%%
t2 = sym('t2');
Q12 = quatmultiply([cosd(45) 0 0 sind(45)],[cos(t2/2) sin(t2/2) 0 0])
%%
Is there any other way of computing this?
Thanks

Respuestas (1)

Chamira Wickramasinghe
Chamira Wickramasinghe el 9 de Ag. de 2017
I found the answer. If anyone having the same issue, when specifying the symbol
instead of typing just,
t=sym('t');
Must type
t=sym('t','real');

Community Treasure Hunt

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

Start Hunting!

Translated by