how to convert table with struct to excel sheet
3 次查看(过去 30 天)
显示 更早的评论
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 )
0 个评论
采纳的回答
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
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!