clear;
clc;
dirpath=input(‘Please input files path:\n‘,‘s‘);
list=dir(dirpath);
len=length(list)
h=44.5;
j=1;
fid = fopen(‘result.txt‘,‘w‘);
for i=3:len
filepath=[dirpath ‘\‘ list(i).name]
[a b c] = textread(filepath,‘%*d %*d %*d %*d %*d %*d %f %f %f %*f %*f %*f %*f‘,‘headerlines‘,17) ;
m=1e-6*77.6*a/(b+273.15)*(40136+148.73*b-h)/5*1000;
n=1e-6*(374700+273*(71.6-77.6))*(c/100*6.11.*10.^(7.5.*b./(b+273.15)))./(b+273.15).^2*(11000-h)/5*1000;
name=repmat(filepath(10:12),length(m),1);
fprintf(fid,‘%3s %.6f %.6f %.6f\n‘,filepath(9:11),nanmean(m),nanmean(n),nanmean(m+n));
result(j,:)={name m n m+n};
j=j+1;
end