% Note, the output of BalloonWinds file is a matrix Winds, where: % the first column contains altitude AGL in ft % the second column contains wind direction in deg % the third column contains wind speed in kn % Also, the outputs are the numerical values of lat, lon in deg % and Ltime, Ldate - when the measurments were taken as char %% Reading heading information lat= textread(FileName,'Latitude: %f',1,'headerlines',3); lon= textread(FileName,'Longitude: %f',1,'headerlines',4); [Ltime,Ldate]=... textread(FileName,'Launch Time: %s UTC Sounding Started on: %s',1,... 'headerlines',10); Ltime=char(Ltime); Ldate=char(Ldate); file = textread(FileName, '%s', 'delimiter', '\n'); %% Reading numerical data N=length(file); i=17; Winds=[0 0 0]; while i <= N H=textread(FileName,'%c',1,'headerlines',i); if H=='-' i=i+5; continue end [q,w,e,r,t,y,u,o]=... textread(FileName,'%f %f %f %f %f %f %f %f',1,'headerlines',i); Winds=vertcat(Winds,[q u o]); % the format is altitude, Wdir, Wspeed i=i+1; end Winds(1,:)=[]; Winds(:,1)=Winds(:,1)-Winds(1,1); clear q w e r t y u o H i N file