Clear Filters
Clear Filters

How to specify column names by writematrix function in Appdesigner?

17 views (last 30 days)
I'm working in app designer. I store 4 columns of data to an excell file.
I have already specified the column names in excell and am using "VariableNamingRule", "preserve". But the column names are transformed into Var1, Var2 etc. or all column names are disappeared.
How do l solve this problem?
Thanks in advance!

Accepted Answer

Tiffany
Tiffany on 1 Apr 2024
Edited: Tiffany on 1 Apr 2024
A potential workaround would be to first use array2table to convert the array into a table and set the column labels by using the property 'VariableNames'. Then you can use writetable to export the data to an excel file.
writetable(array2table(insert_data, 'VariableNames', insert_col_labels), 'filename.xls')
  3 Comments
piston_pim_offset
piston_pim_offset on 22 Apr 2024
@Tiffany it workes when "append" option is selected for "writemode" in writetable command. But, when I overwrite the data the template is gone.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!