Cast quaternion/octonion variable to different data type.
(Quaternion and octonion overloadings of standard MATLAB® function)
b = cast(q, newclass)
cast converts the components of a quaternion to a different data type. By default, the components of a quaternion have the default MATLAB® data type double.
>> q = cast(quaternion(1,2,3,4), 'uint8') q = 1 + 2 * I + 3 * J + 4 * K >> class(q) ans = quaternion >> class(x(q)) ans = uint8