Suppose we have a 1x3 table A=table(1,2,3);
whose header names should contain a mix of numericals and non-numericals:
A.Properties.VariableNames={'from 1st-5th' 'from 6th-10th' ... 'from 11th-15th'};
and generates the following error:
from 1st-5th' is not a valid variable name.
I tried the sprintf
function to solve this error, but the formatSpec
parameter is confusing. Furthermore, I read about eval
and would like to know whether it is helpful in my context.
Outcome of genvarname
use: