Effacer les filtres
Effacer les filtres

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

7 vues (au cours des 30 derniers jours)
farzad
farzad le 26 Déc 2019
Commenté : farzad le 26 Déc 2019
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

Réponse acceptée

Bhaskar R
Bhaskar R le 26 Déc 2019
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 commentaires
farzad
farzad le 26 Déc 2019
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 le 26 Déc 2019
please check my next question , I explained better

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by