This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Numeric Types

Integer and floating-point data

Numeric classes in MATLAB® include signed and unsigned integers, and single-precision and double-precision floating-point numbers. By default, MATLAB stores all numeric values as double-precision floating point. (You cannot change the default type and precision.) You can choose to store any number, or array of numbers, as integers or as single-precision. Integer and single precision arrays offer more memory-efficient storage than double precision.

All numeric types support basic array operations, such as subscripting, reshaping, and mathematical operations.


double Convert to double precision
single Convert to single precision
int8 Convert to 8-bit signed integer
int16 Convert to 16-bit signed integer
int32 Convert to 32-bit signed integer
int64 Convert to 64-bit signed integer
uint8 Convert to 8-bit unsigned integer
uint16 Convert to 16-bit unsigned integer
uint32 Convert to 32-bit unsigned integer
uint64 Convert to 64-bit unsigned integer
cast Cast variable to different data type
typecast Convert data types without changing underlying data
isinteger Determine if input is integer array
isfloat Determine if input is floating-point array
isnumeric Determine if input is numeric array
isreal Determine whether array is real
isfinite Array elements that are finite
isinf Array elements that are infinite
isnan Array elements that are NaN
eps Floating-point relative accuracy
flintmax Largest consecutive integer in floating-point format
Inf Infinity
intmax Largest value of specified integer type
intmin Smallest value of specified integer type
NaN Not-a-Number
realmax Largest positive floating-point number
realmin Smallest positive normalized floating-point number
Was this topic helpful?