필터 지우기
필터 지우기

GUIDE uitable saved to excel WITH column headings

조회 수: 1 (최근 30일)
Jason
Jason 2019년 10월 13일
댓글: Jalaj Gambhir 2019년 10월 16일
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
Jason
Jason 2019년 10월 16일
Hello. Yes i used to do this as per link but the recomnendation now is NOT to use xlswrite Thanks
Jalaj Gambhir
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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by