Add variables to table or timetable
T2 = addvars(
adds the variables specified byT1
,var1,...,varN
)var1,…,varN
to the right of the last variable ofT1
. The input argumentsvar1,…,varN
can include arrays of any type, tables, and timetables. All input arguments must have the same number of rows.
T2 = addvars(
inserts the variables to the left of the table variable indicated byT1
,var1,...,varN
,'Before',location
)location
(see diagram). You can specifylocation
as a variable name, or a numeric or logical index.
T2 = addvars(
inserts the variables to the right of the table variable indicated byT1
,var1,...,varN
,'After',location
)location
.
Use single quotes for the input names'Before'
,'After'
, and'NewVariableNames'
. To avoid confusion with variable inputs, do not use double-quoted string scalars (such as"Before"
) for these names.