fid=fopen(‘E:\data_point\test\ok\b.txt’,‘w’);
[m,n]=size(A)
for i=1:1:m
for j=1:1:n
if j==n
fprintf(fid,’%gn’,A(i,j));
else
fprintf(fid,’%gt’,A(i,j));
end
end
end
fclose(fid);
【matlab】矩阵数据转换为txt文件
最新推荐文章于 2022-04-16 11:00:34 发布
fid=fopen(‘E:\data_point\test\ok\b.txt’,‘w’);
[m,n]=size(A)
for i=1:1:m
for j=1:1:n
if j==n
fprintf(fid,’%gn’,A(i,j));
else
fprintf(fid,’%gt’,A(i,j));
end
end
end
fclose(fid);