This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Identifying Numeric Classes

You can check the data type of a variable x using any of these commands.



whos x

Display the data type of x.

xType = class(x);

Assign the data type of x to a variable.


Determine if x is a numeric type.

isa(x, 'integer')
isa(x, 'uint64')
isa(x, 'float')
isa(x, 'double')
isa(x, 'single')

Determine if x is the specified numeric type. (Examples for any integer, unsigned 64-bit integer, any floating point, double precision, and single precision are shown here).


Determine if x is real or complex.


Determine if x is Not a Number (NaN).


Determine if x is infinite.


Determine if x is finite.

Was this topic helpful?