isinteger
Determine whether input is integer array
Syntax
Description
returns
logical TF = isinteger(A)1 (true) if A is an array
of integer type. Otherwise, it returns logical 0
(false).
Integer types in MATLAB® include: int8, int16,
int32, int64, uint8,
uint16, uint32, and uint64. For
more information, see Integer Classes.
Examples
Input Arguments
Tips
For a floating-point number of a
singleordoubletype, you can check if it is also an integer by using theroundfunction (within the floating-point relative accuracyeps). If the rounded value of the number is equal to the original value before rounding, then the number is an integer. For example,2 == round(2)returns logical1(true) since2is an integer.
Extended Capabilities
Version History
Introduced before R2006a