My column and row names are not transferring to Excel when I use writetable on App Designer

12 ビュー (過去 30 日間)
I cannot get the column or row names to transfer to excel when using writetable on App Designer.
app.UITable3.Data=Temperature ; % Temperature is a combination of table 1 and 2
Names={'CH1','CH2','CH3','CH4','CH5','CH6','CH7','CH8','CH9','CH10','CH11','CH12','CH13','CH14','CH15','CH16','CH17','CH18','CH19','CH20'};
app.UITable3.ColumnName=Names; % this table looks correct on the app
LineNumber = 1 ; % Just an example, edit field defines this
InputFile=('Temperature Table Line %s.xlsx');
filename=sprintf(InputFile,LineNumber);
t=table(app.UITable3.Data); % When I don't use this line and the next is "writematrix(app.UITable3.Data,...) I only get values
writetable(t,filename)
In one case I need column names and on table 4 I need both column and row names to export to Excel. What can I do?
Thank you.
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 3 日
app.UITable3.Data=Temperature ; % Temperature is a combination of table 1 and 2
What is class(temperature)?

サインインしてコメントする。

採用された回答

dpb
dpb 2022 年 6 月 3 日
Read the writetable doc --
writetable(t,filename,'writevariablenames',1)
There are many other options available as well, see the examples and use what you need to get the desired result.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by