Type of
IndexingResult Syntax Rows VariablesDot Indexing extracte
d dataT.varT.
(varindex)All rows One variable, specified
by var (a name) or by
varindex (a number)Dot Indexing extracte
d dataT.var(rows
)One or more rows,
specified by rowsOne variable, specified
by var (a name)
Variables
Propertyextracte
d dataT.Variable
sAll rows All variables when they
can be horizontally
concatenated into an
array
Subscripting
by Variable
Typetable S =
vartype(ty
pe);T(rows,S)One or more rows,
specified by rowsOne or more variables
of the specified type
(for example,
'numeric')Subscripting
by Variable
Typeextracte
d dataS =
vartype(ty
pe);T{rows,S}One or more rows,
specified by rowsOne or more variables
of the specified type
(for example,
'numeric')How to Specify Rows to Access
When indexing into a table with parentheses, curly braces, or dot indexing, you can
specify rows as a colon, numeric indices, or logical expressions. Furthermore, you can
index by name using a single row name or a cell array of row names.
A logical expression can contain curly braces or dot indexing to extract data from which
you can define the subset of rows. For example, rows = T.Var2>0 returns a logical
array with logical true ( 1 ) for rows where the value in the variable Var2 is greater than
zero.
How to Specify Variables to Access
When indexing into a table with parentheses or curly braces, you can specify vars as a
colon, numeric indices, logical expressions, a single variable name, a cell array of variable
names, or as the output of the vartype function..
Access Data in a Table