fmi = 'resultMI.bin';
fcmi = 'resultCMI.bin';
tflist = 'tfList.txt';
met = 'MetSiteInfo.txt';


f1 = fopen(fmi, 'rb');
f2 = fopen(fcmi, 'rb');

row1 = fread(f1, 1, 'int32', 0, 'b');
col1 = fread(f1, 1, 'int32', 0, 'b');
MI = zeros(row1, col1);

row2 = fread(f2, 1, 'int32', 0, 'b');
col2 = fread(f2, 1, 'int32', 0, 'b');
cMI = zeros(row2, col2);

for i = 1 : row1
  line = fread(f1, col1, 'double', 0, 'b');
  MI(i,:) = line;
end

for i = 1 : row2
  line = fread(f2, col2, 'double', 0, 'b');
  cMI(i,:) = line;
end

tfname = cell(row1, 1);
a = importdata(tflist);
for i = 1 : numel(a)
  tfname{i} = a(i);
end

MetSiteInfo = cell(1, col1);
b = importdata(met);
spl = regexp(b, '\t', 'split');
for j = 1 : numel(spl)
  aa = regexp(spl{j}, '###', 'split');
  MetSiteInfo{j} = aa;
end

save PRAD_TF_s1_all cMI MI MetSiteInfo tfname
save tfname tfname
fclose(f2)
fclose(f1)

