clc
clear all
folder='EPL3_2009\EPL3\Hm0';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;
Hm0=[];
date=[];
for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Hm0_day,date_day]=ReadHm0(filename);
    Hm0=[Hm0 Hm0_day]; 
    date=[date date_day];
    %pause
end

%%2010
folder='EPL3_2010\EPL3\Hm0';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Hm0_day,date_day]=ReadHm0(filename);
    Hm0=[Hm0 Hm0_day]; 
    date=[date date_day];
    %pause
end

%%2011
folder='EPL3_2011\EPL3\Hm0';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Hm0_day,date_day]=ReadHm0(filename);
    Hm0=[Hm0 Hm0_day]; 
    date=[date date_day];
    %pause
end

%%2012
folder='EPL3_2012\EPL3\Hm0';
M_dir=dir(folder);
M_dir=M_dir(3:end,1);
%Spectra=struct;
%s_i=0;

for m_i=1:length(M_dir)
    filename=[folder '/' M_dir(m_i,1).name]%;
    [Hm0_day,date_day]=ReadHm0(filename);
    Hm0=[Hm0 Hm0_day]; 
    date=[date date_day];
    %pause
end

Hm0(Hm0==999)=NaN;
%%
if 1
    plot(date,Hm0)
    datetick('x')
end

save ('Hmo.mat','date','Hm0')