renamevars

Rename variables in table.

📝 Syntax

  • TB = renamevars(TA, varsNames, newNames)

📥 Input argument

  • TA - Input table.

  • varsNames - Variable names in input table: character vector, string array or cell array of character vectors.

  • newNames - New names for variables: character vector, string array or cell array of character vectors.

📤 Output argument

  • TB - Table object with variable names modified.

📄 Description

TB = renamevars(TA, varsNames, newNames) renames the variables in the tableTA as specified byvarsNames and assigns them the new names provided innewNames.

You can also rename all the variables in a table by assigning new names to itsVariableNames property usingT.Properties.VariableNames = newNames.

In this case,newNames must be a string array or a cell array of character vectors.

💡 Example

🔗 See also

table, removevars.

🕔 History

Version
📄 Description

1.9.0

initial version

Last updated

Was this helpful?