Data Type Identification
Determine data type of a variable
MATLAB® has many functions to identify the data type of a variable or
to determine whether a variable has a specific data type. Use these
functions when calling or writing code that depends on variables having
specific data types.
Functions
expand all
Numeric Data Types
isfloat | Determine if input is floating-point array |
isinteger | Determine whether input is integer array |
islogical | Determine if input is logical array |
isnumeric | Determine whether input is numeric array |
isreal | Determine whether array uses complex storage |
issparse | Determine whether input is sparse |
Characters and Strings
isstring | Determine if input is string array |
ischar | Determine if input is character array |
iscellstr | Determine if input is cell array of character vectors |
Cells, Structures, and Tables
iscell | Determine if input is cell array |
isstruct | Determine if input is structure array |
istable | Determine whether input is table |
istimetable | Determine if input is timetable |
Other Types
is* | Detect state |
isa | Determine if input has specified data type |
iscategorical | Determine whether input is categorical array |
isenum | Determine if variable is enumeration |
isgraphics | True for valid graphics object handles |
isjava | Determine if input is Java object |
isobject | Determine if input is MATLAB object |
Information About Variables
Topics
Fundamental MATLAB Classes
There are many different data types, or classes, that you can
work with in MATLAB. You can build matrices and arrays of floating-point and integer data,
characters and strings, logical true
and false
values, and so on. Function handles connect your code with any MATLAB function regardless of the current scope. Tables, timetables, structures,
and cell arrays provide a way to store dissimilar types of data in the same
container.