How to multiply quaternions with symbols

3 Ansichten (letzte 30 Tage)
Chamira Wickramasinghe
Chamira Wickramasinghe am 8 Aug. 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

Antworten (1)

Chamira Wickramasinghe
Chamira Wickramasinghe am 9 Aug. 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