matlab 将矩阵写入文件

来源:互联网 发布:中兴 知乎 编辑:程序博客网 时间:2024/06/01 10:23
function write_infile( filename,source_matrix )%TEST Summary of this function goes here%  write matrix to filefid=fopen(filename,'a');[x,y]=size(source_matrix);for i=1:x    for j=1:y-1        fprintf(fid,'%f\t',source_matrix(i,j));    end    fprintf(fid,'%f\n',source_matrix(i,y));%每一行回车\nendfclose(fid);end


原创粉丝点击