MATLAB: Hi, how can I name 561 columns in few steps

datadata importMATLABmatrix manipulationstringvector

I have "AssetName" vector 1×561 and respective matrix of "AssetReturns" 255×561 for each of the 561 Assets. i want to have the same result as–> AssetName = {'pinco','pallo', 'caio', 'sempronio'} just I do not want to type 561 names.. any idea? thanks a lot in advance

Best Answer

tab = array2table(AssetReturns);
tab will now be a table object with column names such as 'Var1', 'Var2'.
If you had a cell array of strings with the names, you could
tab = array2table(AssetReturns, 'VariableNames', TheCellArrayOfNames);