フィルターのクリア

How to include header text in a Table when writing to Excel?

7 ビュー (過去 30 日間)
farzad
farzad 2019 年 12 月 26 日
コメント済み: farzad 2019 年 12 月 26 日
Hi All
I have to write a table after converting it to array , to Excel . as you can see in the following example taken from this page, if you print the TT you can see the header. but when I converted it to array and tried to write it to Excel ,there was no header
[c,hist,edges,rmm,idx] = rainflow(Z,t);
TT = array2table(c,'VariableNames',{'Count','Range','Mean','Start','End'})
TT=7×5 table
Count Range Mean Start End
_____ _____ ____ _____ ___
0.5 3 -0.5 0 1
0.5 4 -1 1 3
1 4 1 5 6
0.5 8 1 3 4
1 6 1 10 13
0.5 9 0.5 4 8
0.5 10 1 8 15

採用された回答

Bhaskar R
Bhaskar R 2019 年 12 月 26 日
In table to array conversion only one type of the data will be displayed, head(string) would skipped.
If you want to write data to excel without converting table to array you can include header
writetable(TT,'output_file.xlsx'); % assumed filename "output_file"
  2 件のコメント
farzad
farzad 2019 年 12 月 26 日
I get this error :
Error using writetable (line 124)
Unable to write to sheet '' in file 'Ystat.xlsx'. Disable sheet protection, disable workbook's Mark as Final
option, and ensure input does not exceed cell capacity.
farzad
farzad 2019 年 12 月 26 日
please check my next question , I explained better

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by