I found the answer on the sourceforge documentation page
octave:32> a=quaternion(1,2,3,4);
octave:33> a
a = 1 + 2i + 3j + 4k
octave:34> a.w
ans = 1
octave:35> a.x
ans = 2
octave:36> a.y
ans = 3
octave:37> a.z
ans = 4
Question
I am working in octave. I have a quaternion vector q . Let say it's scalar component is q1 and the vector components are q2,q3,q4 . I need the values of q1,q2,q3,q4 seperately using octave. For example,
if q = 1 + 2i + 3j + 4k
then q1 = 1 , q2 = 2 , q3 = 3 , q4 = 4 ;
I have googled but have not found any function to implement this in octave. Thanks in advance for your help.
Solution
I found the answer on the sourceforge documentation page
octave:32> a=quaternion(1,2,3,4);
octave:33> a
a = 1 + 2i + 3j + 4k
octave:34> a.w
ans = 1
octave:35> a.x
ans = 2
octave:36> a.y
ans = 3
octave:37> a.z
ans = 4