cast
Convert an array to a different element type.
Syntax
Section titled “Syntax”B = cast(A, newclass)Description
Section titled “Description”Returns A converted to the type named by newclass (a string like 'double', 'single', 'int32', 'uint8', 'logical', etc.). Equivalent to <newclass>(A) but lets the type name be a runtime string.
Examples
Section titled “Examples”cast(3.7, 'int32') % 3 (truncated to int)cls = 'single'; cast(pi, cls) % 3.14159 in single precision