GUIDE uitable saved to excel WITH column headings
1 次查看(过去 30 天)
显示 更早的评论
Whats the best way to save a GUIDE uitable to an excel file. The uitable consists of doubles and I need to include the headings in the excel file. I used to use xlswrite but the documentation suggest to use writematrix or write table but i cannot get the headings. I would also need to be able to then read in the excel data as well as the headings.
Thanks
Jason
3 个评论
Jalaj Gambhir
2019-10-16
In the example cited in the above link, writecell works correctly as well, because 'CombData' is a cell array (the reason why writematrix and writetable does not work). You can combine your column headings (character data) and double data in a cell array, and you can use writecell.
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(LastName,Age,Height,Weight,BloodPressure);
writetable(T,'myData.xls');
Using the above example you can create headings as the variable names such as LastName, Age, etc.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!