Data Type Identification
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
Numeric Data Types
Characters and Strings
Dates and Times
isdatetime |
Determine if input is datetime array |
isduration |
Determine if input is duration array |
iscalendarduration |
Determine if input is calendar duration array |
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 isJavaobject |
isobject |
Determine if input isMATLABobject |
Information About Variables
whos |
List variables in workspace, with sizes and types |
class |
Class of object |
underlyingType |
Type of underlying data determining array behavior |
isUnderlyingType |
Determine whether input has specified underlying data type |
validateattributes |
Check validity of array |
Topics
There are many different data types, orclasses, that you can work with in MATLAB. You can build matrices and arrays of floating-point and integer data, characters and strings, logicaltrue
andfalse
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.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)