tongqingliu

保持学习的态度

Matlab文件操作

clear;clc;
A = magic(4);
fid = fopen('test.txt','wt');
for i = 1:size(A,1)
    for j = 1:size(A,2)
        fprintf(fid,'%d\t',A(i,j));
    end
    fprintf(fid,'\n');
end

clear;
A = importdata('test.txt');

posted on 2017-03-24 22:13  tongqingliu  阅读(164)  评论(0编辑  收藏  举报

导航