Skip to content

isnumeric

Test whether the input is a numeric type.

tf = isnumeric(A)

Returns true when A’s element type is any numeric type — integer, floating-point, or complex. Returns false for strings, logicals, structs, cells, tables, and other non-numeric containers.

Applied elementwise for non-scalar inputs in script mode; scalar in Excel-compatible mode.

isnumeric(3.14) % 1
isnumeric('hello') % 0
isnumeric(true) % 0 (logicals are not numeric)
  • isinteger — Test whether the input is integer-typed (or, in script mode, integer-valued).
  • islogical — Test whether the input is of logical (boolean) type.