%生成文件
A=[1 1 1 1 1 2 2 2 2 1 1 1 1;
1 1 1 1 2 2 1 2 2 1 1 1 1;
1 1 1 2 2 1 1 1 2 2 1 1 1 ;
1 1 2 2 1 1 1 1 1 2 2 1 1;
1 1 1 2 2 1 1 1 2 2 1 1 1 ;
1 1 1 1 2 2 1 2 2 1 1 1 1;
1 1 1 1 1 2 2 2 2 1 1 1 1];
dlmwrite('data1.txt',A,'delimiter','\t','-append');
%读取画图
A=dlmread('data1.txt');
contourf(A,'linestyle','none');