uint32 - 32-bit unsigned integer arrays - MATLAB (original) (raw)
Main Content
32-bit unsigned integer arrays
Description
Variables in MATLABĀ® of data type (class) uint32
are stored as 4-byte (32-bit) unsigned integers. For example:
Name Size Bytes Class Attributes
y 1x1 4 uint32
For more information on integer types, see Integers.
Creation
Some array creation functions allow you to specify the data type. For instance,zeros(100,'uint32')
creates a 100-by-100 matrix of zeros of typeuint32
.
If you have an array of a different type, such as double
orsingle
, then you can convert that array to an array of typeuint32
by using the uint32
function.
Syntax
Description
Y = uint32([X](#d126e1939222))
converts the values inX
to type uint32
. Values outside the range [0,232-1] map to the nearest endpoint.
Input Arguments
Input array, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: double
| single
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint64
| logical
| char
Examples
Convert a double-precision variable to a 32-bit unsigned integer.
x = 100; xtype = class(x)
Extended Capabilities
Theuint32
function fully supports tall arrays. For more information, see Tall Arrays.
The uint32
function fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced before R2006a