Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

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

See Also

class

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS