how to convert table with struct to excel sheet

3 ビュー (過去 30 日間)
hussain abdelaziz
hussain abdelaziz 2021 年 4 月 8 日
コメント済み: hussain abdelaziz 2021 年 7 月 18 日
i need to know how to convert this table with struct to an excel files with all the data in ... please if you can help but the code to me ( i don't need file name ) the table has many struct

採用された回答

Mohammad Sami
Mohammad Sami 2021 年 4 月 8 日
Not really sure about what your data looks like. Assuming your structs are compatible, you can concatenate them together.
s = vertcat(result.bw{:});
s = struct2table(s);
writetable(s,'myexcel.xlsx');
  4 件のコメント
Mohammad Sami
Mohammad Sami 2021 年 4 月 10 日
Yes that can be done.
if true
n = cellfun(@length,result.bw);
f = repelem(result.fileName,n);
s = vertcat(result.bw{:});
s = struct2table(s);
s.fileName = f;
writetable(s,'myexcel.xlsx');
end
hussain abdelaziz
hussain abdelaziz 2021 年 7 月 18 日
Dr mohamed ur code was working good when i update matlab now i try to make it don't work when i wrote
n = cellfun(@length,result.bw);
it says Error using cellfun
Input #2 expected to be a cell array, was struct instead.
what is the problem ?

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by