% Note, the output of JAAWINWinds 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 numerical data [lat,lon]=textread(FileName,... 'Forecast Model Grid Pt: Latitude-> %f N Longitude-> %f',1,'headerlines',4); [f1,f2,f3,f4]=textread(FileName,... 'Valid Time: %f Z %f %s %f',1,'headerlines',2); Ltime=[num2str(fix(f1/100)) ':' num2str(f1-fix(f1/100)*100,'%02.0f')]; Ldate=datevec([char(f3) num2str(f2) ',' num2str(f4)]); Ldate=[num2str(Ldate(2),'%02.0f') '/' num2str(Ldate(3),'%02.0f') '/' num2str(Ldate(1))]; file = textread(FileName, '%s', 'delimiter', '\n'); %% Reading numerical data N=length(file); i=19; Winds=[0 0 0]; while i <= N [q,w,e,r]=... textread(FileName,'%f ( %f ) %f %f',1,'headerlines',i); Winds=vertcat(Winds,[q e r]); % the format is altitude, Wdir, Wspeed i=i+1; end [w,e,r]=... textread(FileName,'SFC( %f ) %f %f',1,'headerlines',18); Winds(1,2:3)=[e r]; clear q w e r t y u o H i N file f1 f2 f3 f4 %% Conversion to English units Winds(:,1)=Winds(:,1)*1000; % converting altitude to ft to make outputs the same