Quantcast

Documentation Center

  • Trial Software
  • Product Updates

isinteger

Determine if input is integer array

Syntax

tf = isinteger(A)

Description

tf = isinteger(A) returns true if the array A is an integer type and false otherwise.

An integer array is any of the following integer types and any subclasses of those types:

 MATLAB Integer Types

Examples

These examples show the values isinteger returns when passed specific types:

% uint8 is one of the integer types
isinteger(uint8(1:255))
ans =
     1
% pi returns a double-precision value
isinteger(pi)
ans =
     0
% Constants are double-precision by default
isinteger(3)
ans =
     0
% isinteger returns a logical value
isinteger(isinteger(uint8(3)))
ans =
     0

See Also

| |

Was this topic helpful?