addvars
Add variables to table or timetable
Syntax
Description
T2 = addvars(
adds the arrays specified by T1,var1,...,varN)var1,…,varN as new variables to the
right of the last variable in T1. The input arrays
var1,…,varN can be arrays having any data type, tables, and
timetables. All input arguments must have the same number of rows as
T1.
For example, to add a column vector named A after the last
variable in T1, use T2 = addvars(T1,A).

T2 = addvars(
inserts the variables to the right of the table variable indicated by
T1,var1,...,varN,'After',location)location. You can specify location as a
variable name, or a numeric or logical index.
For example, to insert a column vector named A after table
variable var2, use T2 =
addvars(T1,A,'After','var2').

T2 = addvars(
inserts the variables to the left of the table variable indicated by
T1,var1,...,varN,'Before',location)location.
For example, to insert a column vector named A before table
variable var3, use T2 =
addvars(T1,A,'Before','var3').
Examples
Input Arguments
Limitations
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.
Extended Capabilities
Version History
Introduced in R2018a