Imaginary part of a complex quaternion
(Quaternion and octonion overloadings of standard MATLAB® function)
Y = imag(X)
imag(X) returns the imaginary part of a complex quaternion. If X is a real quaternion, imag(X) returns zero.
The concept of the imaginary part of a quaternion should not be confused with the vector part (returned by the function vector or v).
>> q = complex(quaternion(1,2,3,4), quaternion(5,6,7,8)) q = (1+5i) + (2+6i) * I + (3+7i) * J + (4+8i) * K >> imag(q) ans = 5 + 6 * I + 7 * J + 8 * K >> real(q) ans = 1 + 2 * I + 3 * J + 4 * K