close all
clear all

files = dir('WaveData*.mat');
%Put in chronological order.
for i = 1:length(files)
    load(files(i).name)
    SerialDate(i) = sdate;
end
[Dates IX] = sort(SerialDate);
files = files(IX);
clear SerialDate Dates IX i;


ffid = fopen('WaveDataSummary4.txt','w');

for i = 1:length(files)
    
    load(files(i).name);
    
    text = [num2str(i) '  ' files(i).name '  Hs = ' num2str(SigWaveHeight) ' m  Tp = ' num2str(PeakPeriod) ' s  ' num2str(BudalLimit,4) ' W'];
    disp(text);
    fprintf(ffid,'%s\n',text);
    Hs(i) = SigWaveHeight;   
    SerialDate(i) = sdate;
end
fclose(ffid);

figure
plot(1:length(files),Hs)
ylabel('H_s (m)');

