Save structure in Excel

3 次查看(过去 30 天)
Dear all,
I have a structure, which I want to save in Excel, in a way that each table is saved in different Excel sheet. Could you please help me with programming it?
dataset =
struct with fields:
Credit_broad: [205×48 table]
Credit_narrow: [205×48 table]
TotC_HH: [205×48 table]
TotC_NFC: [205×48 table]
GDP: [205×48 table]
...

采纳的回答

Stephen23
Stephen23 2021-3-4
编辑:Stephen23 2021-3-4
F = fieldnames(dataset);
N = 'myfile.xlsx';
for k = 1:numel(F)
T = dataset.(F{k});
writetable(T, N, 'Sheet',F{k})
end
  1 个评论
Joanna Przeworska
It works as I expected. Thank you very much.
Kind regards,
JP

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by