istable
Determine if input is table
Syntax
Description
Examples
Determine If Input Is Table
Create a table, T
.
T = table(categorical(["M";"F";"M"]),[45 45;41 32;40 34],... ["NY";"CA";"MA"],[true;false;false])
T=3×4 table
Var1 Var2 Var3 Var4
____ ________ ____ _____
M 45 45 "NY" true
F 41 32 "CA" false
M 40 34 "MA" false
Verify that T
is a table.
tf = istable(T)
tf = logical
1
Test Data Extracted from Table
Create a table, T
.
T = table(categorical(["M";"F";"M"]),[45 45;41 32;40 34],... ["NY";"CA";"MA"],[true;false;false])
T=3×4 table
Var1 Var2 Var3 Var4
____ ________ ____ _____
M 45 45 "NY" true
F 41 32 "CA" false
M 40 34 "MA" false
Extract the second and fourth variables from T
. When you index into a table using smooth parentheses, the result is a table.
T2 = T(:,[2 4])
T2=3×2 table
Var2 Var4
________ _____
45 45 true
41 32 false
40 34 false
tf = istable(T2)
tf = logical
1
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×3
45 45 1
41 32 0
40 34 0
tf = istable(A)
tf = logical
0
Input Arguments
A
— Input array
array
Input array.
Extended Capabilities
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Version History
Introduced in R2013b
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)