<< istable | Tables | renamevars >> |
TB = removevars(TA, varsNames) |
Input table.
Variable names in input table to remove: character vector, string array or cell array of character vectors.
Table object modified.
TB = removevars(TA, varsNames) removes the variables specified by varsNames from the table TA 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 using T(:, 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 |
Allan CORNET