Quaternion Function Reference

cast

Cast quaternion/octonion variable to different data type.
(Quaternion and octonion overloadings of standard MATLAB® function)

Syntax

b = cast(q, newclass)

Description

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.

Examples

>> 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

See Also

QTFM function: convert
MATLAB® function: cast

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.