编程技巧:matlab fprintf输出到txt文件实现换行

<code class="language-plain"><textarea readonly=”readonly” name=”code” class=”matlab”>   

result_file=fopen('D:\buildingdata\test0\result.txt','w+');
fprintf(result_file,'%d',1);
fprintf(result_file,'\r\n');

单纯的使用‘\n’好像不行,所以查阅了资料使用上述的'\r\n'可以:

参考博文:https://blog.csdn.net/suyunyixuan/article/details/74025701

猜你喜欢

转载自blog.csdn.net/weixin_38907330/article/details/80930212
今日推荐