MATLAB Help Center
Determine if input is table or timetable
Since R2021b
tf = istabular(A)
tf = istabular(A) returns logical 1 (true) if A is either a table or a timetable, and logical 0 (false) otherwise.
tf
A
1
true
0
false
This syntax is equivalent to tf = istable(A) || istimetable(A), but is more convenient.
tf = istable(A) || istimetable(A)
collapse all
Create a table using the table function.
table
T = table([98;97.5;97.9;98.1;101],[120;111;119;117;118])
T=5×2 table Var1 Var2 ____ ____ 98 120 97.5 111 97.9 119 98.1 117 101 118
To confirm that T is either a table or a timetable, use the istabular function.
T
istabular
tf = istabular(T)
tf = logical 1
Now convert T to a timetable.
TT = table2timetable(T,RowTimes=seconds(1:5))
TT=5×2 timetable Time Var1 Var2 _____ ____ ____ 1 sec 98 120 2 sec 97.5 111 3 sec 97.9 119 4 sec 98.1 117 5 sec 101 118
The istabular function still returns 1 for TT.
TT
tf = istabular(TT)
However, the istable function returns 0 because TT is a timetable, not a table.
istable
tf = istable(TT)
tf = logical 0
Input array.
True or false result, returned as a 1 or 0 of data type logical.
logical
expand all
The istabular function fully supports tall arrays. For more information, see Tall Arrays.
Introduced in R2021b
table | timetable | iscell | isstruct | isnumeric | isobject | islogical | istable | istimetable
timetable
iscell
isstruct
isnumeric
isobject
islogical
istimetable
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
Europe
Asia Pacific
Contact your local office