我有一个带有嵌套单元格的变量:
hello =
'8' {1x3 cell} {1x3 cell}
'22' {1x3 cell} {1x3 cell}
'97' {1x3 cell} {1x3 cell}
如何使用 MATLAB 将其写入单个 Excel 文件,例如
xlswrite('file',hello)
?
过了一会儿才看了一下。这是我的解决方案和示例问题。
clear all;
clc ;
d = {{'Number'},{'Class A'},{'class B'};{'007'},{'Test One'},{'Test Two'}};
for i = 1:size(d,1)
for j = 1:size(d,2)
if iscell(d(i,j))
d(i,j) = d{i,j};
end
end
end
xlswrite('FileAddress',d);