因此,我正在探索该主题的论坛,但找不到回答我的问题的相关帖子,所以就到这里。我想从 Matlab 将元胞数组另存为 .csv 文件。我的单元格数组的结构如下(这是给我带来麻烦的部分)
>> mycell
mycell =
Columns 1 through 8
[76x1 double] {76x1 cell} {76x1 cell} [76x75 double] [76x1 double] [76x1 double] {76x1 cell} {76x1 cell}
Columns 9 through 17
{76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell} {76x1 cell}
Column 18
{76x1 cell}
所以我一直在尝试自己无济于事的是:
>>
[nrows,ncols]= size(mycell);
filename = output_file;
fid = fopen(filename, 'w');
for row=1:nrows
fprintf(fid, '%d,%s,%s,%d,%d,%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n', mycell{row,:});
end
fclose(fid);
??? Error using ==> fprintf
Function is not defined for 'cell' inputs.
任何建议都非常感谢!谢谢!