Documentation Center

  • Trials
  • Product Updates

isnumeric

Determine if input is numeric array

Syntax

tf = isnumeric(A)

Description

tf = isnumeric(A) returns true if A is a numeric array and false otherwise.

A numeric array is any of the following numeric types and any subclasses of those types:

 MATLAB Numeric Types

Examples

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

% pi returns a numeric value
isnumeric(pi)
ans =
     1
% Complex numbers are numeric
isnumeric(3+7i)
ans =
     1
% Integers are numeric
isnumeric(uint8(1:255))
ans =
     1
% isnumeric returns a logical value
isnumeric(isnumeric(pi))
ans =
     0

See Also

| | | | | | | |

Was this topic helpful?