8-bit signed integer arrays
Variables in MATLAB® of data type (class)
int8 are stored as
1-byte (8-bit) signed integers. For example:
y = int8(10); whos y
Name Size Bytes Class Attributes y 1x1 1 int8
For more information on integer types, see Integers.
Some array creation functions allow you to specify the data type. For instance,
zeros(100,'int8') 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
int8 by using the
X— Input array
Input array, specified as a scalar, vector, matrix, or multidimensional array.
Convert a double-precision variable to an 8-bit signed integer.
x = 100; xtype = class(x)
xtype = 'double'
y = int8(x)
y = int8 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).