how to save a UITable in Excell along with Rows & Column Names (Appdesigner, R2020a)

조회 수: 11 (최근 30일)
i have a data in in a variable 'A', i want to save it in excell file with rows and column names as shown in fighure below.
i tried
A = app.d;
filter = {'*.xlsx'};
[file,path] = uiputfile(filter);
filename = fullfile(path,file);
xlswrite(filename,A);
but this only save table not row names(a,b,c,d,e) and colomn names(Data,Average). kindly guide.

채택된 답변

Mario Malic
Mario Malic 2020년 11월 1일
Use writetable to solve your problem, there's a Name-Value pair that corresponds to your need. Here's the example: https://www.mathworks.com/help/matlab/ref/writetable.html#btydetm-1
  댓글 수: 5
taimour sadiq
taimour sadiq 2020년 11월 8일
Dear Mario More than Thanks for ur Valuable suupport... all was helpfull but ur sentence that i will not get desired output unless i fill UITable.Data properly... and i focused on that while keeping in mind the directions of documentation... and finally i succedded... both with writing row and columns Names along with UIputfile..
i also want to share one of my mistake due to which it take much long time to achieve desire goal.. actually i was taking average of first column and displaying it in first row of second column... but when we assign row and column names then number of rows for each column should be same... so i changed my data and it works... due to this technical mistake which matlab was promting again and again i was not able to get my output even with proper code and syntax of Writetable.. Dear Mario once Again Thanks and i really appreciate that you Guide in such a way that encourage people for poolish them for troubleshooting...
sharing my working code file for those who will get help from this forum in future.

댓글을 달려면 로그인하십시오.

추가 답변 (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