MATLAB: Change variable names in a table change variable namesMATLABvariable change Hi all, I would like to change all variable names within a table, to attached file, a cell array. This is what i use now; rf1.Properties.VariableNames = vars1 Best Answer You can use a cell array of names, like this:rfi.Properties.VariableNames = {'name1','name2',...}See: https://www.mathworks.com/matlabcentral/answers/179129-is-it-possible-to-rename-columns-in-a-table#answer_168467 Related SolutionsMATLAB: Does table creation produce error “VariableNames property must contain one name for each variable in the table” Just figured this out: have to use array2table, T = array2table(rand(30,8), ... 'VariableNames', {'var1' 'var2' 'var3' 'var4' 'var5' ... 'var6' 'var7' 'var8'});However if you want to assign other properties besides names, you have to do that separately, unlike the table command,T.Properties.VariableUnits = {'kg' 'm' 'W' 's' 'g' 'kg' 'm' 'W'}; MATLAB: How to compare two table Table comparisonhttps://www.mathworks.com/matlabcentral/answers/381097-compare-two-tables-with-two-column-combinations#answer_303747 Related QuestionJoining 2 tables to make 1 tableHow to use cells as xlabel in stackedplotApp Designer Table setting column name to variable nameExisting table, populate a column with string (receiving errors)I’m struggling to create a table with namesCopy data from array to tableTransferring variable names from one table to another
Best Answer