%% Get cdf results from data file of transfer-matrix calculation function result=gettmat(filename) fin = fopen(filename, 'r'); str = fgetl(fin); % discard the first line % k = strfind(str, '='); status = 0; result = []; while(~feof(fin)) str = fgetl(fin); if(status==0) Trhop = strread(str); % line of T, rho, p str = fgetl(fin); cds = strread(str);% line of cluster distribution function result = [Trhop([1 2]), cds]; status=1; elseif(status==1) Trhop = strread(str); status=2; else cds = strread(str); result = [result; Trhop([1 2]), cds]; status=1; end end fclose(fin); end