以下这段代码是对元胞数组的换行连续写入文档

time = datestr(now,31);

a = cell(5,1);
a{1} = time;
a{2} = 'order';
a{3} = 'rise';
a{4} = 'rise';
a{5} = 128;
formatSpec = '%s %s %s %s %d \r\n';               %此处换行要加"\r\n"才能换行写入,单独的“\n”不行
fid=fopen('E:\matlab2015a\projects\test\char1.dat','a');
fprintf(fid,formatSpec,a{:,:});

fclose(fid);


多次执行的结果如下:

元胞数组的换行多次写入文档元胞数组的换行多次写入文档

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2022-01-21
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-11-12
  • 2021-11-09
相关资源
相似解决方案