I am writing a function to import an Excel table. I am using 'opts' commands in order to add some versatility to the function. However, when I use readtable(... , opts),the variables for my imported table say 'Var1, Var2, Var3..'. I want my variable names to be the variables contained in the first row of my spreadsheet. How am I able to fix this? Obviously, I don't want to use opts.'VariableNames' and type out each variable that I have. That would take way too long.
P.S. this does not happen when I use juse readtable(..), it only occurs when I have the opts with it.
2 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/528363-using-spreadsheet-column-headers-as-variable#comment_853373
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/528363-using-spreadsheet-column-headers-as-variable#comment_853373
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/528363-using-spreadsheet-column-headers-as-variable#comment_853463
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/528363-using-spreadsheet-column-headers-as-variable#comment_853463
Sign in to comment.