FUNCTION REFERENCE

cast

Convert to another class.

Convert to another class.

Syntax

cast(X, CLASSNAME)

CLASSNAME is 'double', 'single', 'logical', 'char' or an integer class name. Integer targets round half away from zero and saturate.

Example

x = cast(300, 'uint8')

Differences from MATLAB: the 'like' form is not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.