matlab输出txt文件,这个‘\r'为什么不能使txt里内容换行,换'\n'也试了不行啊。
fid=fopen('test.txt','w');symsaa='ThisisaFormatedfile'b=[1:5];c=sin(b);d=cos(b);e=[b;...
fid=fopen('test.txt','w');
syms a
a='This is a Formated file'
b=[1:5];c=sin(b);d=cos(b);
e=[b;c;d];e=e'
count=fprintf(fid,'\r%s',a)
i=1;count=fprintf(fid,'\n')
while(i<6)
cout=fprintf(fid,'\r\b\b%g',e(i,1));
cout=fprintf(fid,'\b%e',e(i,2:3));
i=i+1;
end
fclose(fid); 展开
syms a
a='This is a Formated file'
b=[1:5];c=sin(b);d=cos(b);
e=[b;c;d];e=e'
count=fprintf(fid,'\r%s',a)
i=1;count=fprintf(fid,'\n')
while(i<6)
cout=fprintf(fid,'\r\b\b%g',e(i,1));
cout=fprintf(fid,'\b%e',e(i,2:3));
i=i+1;
end
fclose(fid); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询