32-bit signed integer arrays
Variables in MATLAB® of data type (class)
int32 are stored as
4-byte (32-bit) signed integers. For example:
y = int32(10); whos y
Name Size Bytes Class Attributes y 1x1 4 int32
For more information on integer types, see Integers.
Some array creation functions allow you to specify the data type. For instance,
zeros(100,'int32') creates a 100-by-100 matrix of zeros of type
If you have an array of a different type, such as
single, then you can convert that array to an array of type
int32 by using the
X— Input array
Input array, specified as a scalar, vector, matrix, or multidimensional array.
Convert a double-precision variable to a 32-bit signed integer.
x = 100; xtype = class(x)
xtype = 'double'
y = int32(x)
y = int32 100
This function fully supports tall arrays. For more information, see Tall Arrays.
backgroundPoolor accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).