I have a matrix and a Structure array. I want to export them as an Xlsx file, with the matrix on sheet one and the Structure array on sheet two
1 次查看(过去 30 天)
显示 更早的评论
struct with fields:
W_HP: 211.85
W_LP: 244
W_P1: -1.8104
W_P2: -2.441
W_NET: 451.6
n: 0.4516
Q_condenser: -5.4628e+05
Q_heat_up: 5.2074e+05
Delta_T: 0.55665
rankine =
32.011 105 0 143.63 225 0.001005 994.99 4.1529
631.44 105 0 3699.2 225 0.001005 994.99 0
269.97 55 0.98 2757.6 225 0.0013029 767.51 0
593.03 55 0 3646.5 225 0.0013029 767.51 0
99.606 1 0.95 2562.1 225 0.0010431 958.64 0
32.011 1 0 134.15 225 0.0010431 958.64 4.1795
99.606 1 0 417.44 1928.4 0.0010431 958.64 0
179.89 10 0 762.68 1928.4 0.0011272 887.13 0
32.567 2 0 134.15 1928.4 0.0010605 942.94 0
for the Structure array I dont need the names just the values. Everything I've tried is giving errors so
0 个评论
采纳的回答
chicken vector
2023-4-22
writematrix(cell2mat(struct2cell(structName)), 'filename.xls', 'Sheet', 1);
writematrix(rankine, 'filename.xls', 'Sheet', 2);
Change structName with the name of your struct.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!