VariableNames for table that begins with number

Hello
Is it possible to make variables names, that begins with number, just to use in the table? I need to make a table, whrere variables are numbers and they have variable names {'1/6 oct' '1/3 oct' '1/2 oct' '1 oct' '2 oct'}. Is it maybe possible to add the variable name as a string variable to numbers?

 Accepted Answer

Yes.
tbl = table([1;2;3],'VariableName',{'123abc'})

8 Comments

To be more specific, the ability to have table and timetable variable names that are not valid MATLAB identifier (containing spaces and other characters that are not allowed under the rules in the documentation for the isvarname function) was added in release R2019b.
Is there another way? How to avoid this problem?
What problem? We just said that it is possible.
No, it does not work.
Udklip.PNG
Sorry. As Steven Lord mentioned in his comment, this feature was introduced in MATLAB version R2019b.
If you have an older version, you would need to update the software to do this.
Sorry too, I throught I had R2019b. So if I have R2019a, I just need to update to R2019b?

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!