DebugFiles = 'C:\Users\MATLAB\160826\*1682621.00*';
D = dir(DebugFiles);
Z=0;
fid=fopen(D.name);
for k = 1:3
headers{k} = fgetl(fid);
end
third_header = sscanf(headers{3},'%f');
num_datasets = third_header(end);
datasetheader = {};
for k = 1:num_datasets
datasetheader{k} = fgetl(fid);
end
fread(fid,2,'uint8')
data = {};
for k = 1:num_datasets
dataheader_parsed = sscanf(datasetheader{k},'%d');
num_read = dataheader_parsed(4);
[data{k},count] = fread(fid,num_read,'long');
fread(fid,2,'uint8');
end
fclose(fid);
R=150;
s=1.4*10^(-25)-9.5*10^(-27);
m=1;
for j=height1:10:dataheader_parsed(4)-9
A=0;
B=0;
for k=j:j+9
A =+ data{2}(k,1);
B =+ data{4}(k,1);
end
On1(m,1) = A;
Off1(m,1)= B;
if m >= 2
On2(m-1,1)=A;
Off2(m-1,1)=B;
end
m=m+1;
end
n= 1./(2.*s.*R).*((On1.*Off2)./(On2.*Off1));
figure;
plot(n, 1:numel(n))
ylim([10 30])
xlabel('水蒸気濃度')
ylabel('高さ[km]')