MATLAB Function Reference cast Cast variable to different data type Syntax * B = cast(A, newclass) Description B = cast(A, newclass) casts A to class newclass. A must be convertible to class newclass. newclass must be the name of one of the built in data types. Examples * a = int8(5); b = cast(a,'uint8'); class(b) ans = uint8