Save structure in Excel

3 ビュー (過去 30 日間)
Joanna Przeworska
Joanna Przeworska 2021 年 3 月 4 日
コメント済み: Joanna Przeworska 2021 年 3 月 4 日
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
Joanna Przeworska 2021 年 3 月 4 日
It works as I expected. Thank you very much.
Kind regards,
JP

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

その他の回答 (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