16-bit unsigned integer arrays
Variables in MATLAB®of data type (class)uint16
are stored as 2-byte (16-bit) unsigned integers. For example:
y = uint16(10); whosy
Name Size Bytes Class Attributes y 1x1 2 uint16
For more information on integer types, seeIntegers.
Some array creation functions allow you to specify the data type. For instance,0(100年,“uint16”)
creates a 100-by-100 matrix of zeros of typeuint16
.
If you have an array of a different type, such asdouble
orsingle
, then you can convert that array to an array of typeuint16
by using theuint16
function.