function k=read_matrix(flname)
%flname:文件名
fid = fopen(flname,'r');%打开数据文件
m=fread(fid,[1,1],'int32');%读取行数
n=fread(fid,[1,1],'int32');%读取列数
k=zeros(m,n);
for i=1:m
for j=1:n
k(i,j)=fread(fid,[1,1],'double');%读取数据
end
end
fclose(fid);