Help CenterHelp Center
Determine if input is table
tf = istable(A)
example
tf = istable(A)returns logical1(true) ifAis a table, and logical0(false) otherwise.
A
1
true
0
false
collapse all
Create a table,T.
T
T = table(categorical(["M";"F";"M"]),[45 45;41 32;40 34],...["NY";"CA";"MA"],[true;false;false])
T=3×4 tableVar1 Var2 Var3 Var4 ____ ________ ____ _____ M 45 45 "NY" true F 41 32 "CA" false M 40 34 "MA" false
Verify thatTis a table.
tf = istable(T)
tf =logical1
Extract the second and fourth variables fromT. When you index into a table using smooth parentheses, the result is a table.
T2 = T(:,[2 4])
T2=3×2 tableVar2 Var4 ________ _____ 45 45 true 41 32 false 40 34 false
tf = istable(T2)
Extract data from the second and fourth variables. When you index into a table using curly braces, the result is a matrix, not a table.
A = T{:,[2 4]}
A =3×345 45 1 41 32 0 40 34 0
tf =logical0
Input array.
This function fully supports distributed arrays. For more information, seeRun MATLAB Functions with Distributed Arrays(Parallel Computing Toolbox).
table|iscell|isstruct|isnumeric|isobject|islogical|istimetable|istabular
table
iscell
isstruct
isnumeric
isobject
islogical
istimetable
istabular
如果dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office