TB = removevars(TA, varsNames)
| Parameter | Description |
|---|---|
| TA | Input table. |
| varsNames | Variable names in input table to remove: character vector, string array or cell array of character vectors. |
| Parameter | Description |
|---|---|
| TB | Table object modified. |
TB = removevars(TA, varsNames) removes the variables specified byvarsNames from the tableTA and stores the remaining variables in T2.
You can specify the variables by name, position, or using logical indices.
You can also remove variables from a table usingT(:, varsNames) = [].
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
% Convert the cell array to a table
T1 = cell2table(C)
T2 = removevars(T1, 'C2')
| Version | Description |
|---|---|
| 1.9.0 | initial version |