Convert structure to xls file

I have a structure that has 13 fields each with a table that contains a 9x5 table. How can I convert these to one excel file on different sheets?
fieldnames:
muscles = {'Rt_Mid_Delt' ,'Rt_Lat_Dorsi' ,'Rt_Lumbar_ES' ...
,'Rt_Thoracic_ES','Rt_Lat_Gastro', 'Rt_Ext_Oblique' ...
,'Rt_Int_Oblique','Rt_Rect_Abdom','Rt_Glut_med' ...
,'Rt_Semiten','Rt_VMO','Rt_Rhomboid','Rt_Serratus' };

1 Kommentar

Geoff Hayes
Geoff Hayes am 16 Dez. 2014
Alyna - how are the structure and the table related? Or do you have a structure (with 13 fields) and a 9x5 table? Or is each element in the 9x5 table a structure (with 13 fields)? Can you provide an example?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Guillaume
Guillaume am 16 Dez. 2014

1 Stimme

Probably the easiest (but not the fastest) is to use writetable:
for fn = fieldnames(muscles)'
writetable(muscles.(fn{1}), 'file.xlsx', 'Sheet', fn{1});
end

Gefragt:

am 16 Dez. 2014

Bearbeitet:

am 16 Dez. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by