clear all
close all
warning off all
clc

load('MAT\rtkprof_data');
ioi = 1:2:7;
%ioi = [1,4:7];
dirr = {'(ZW - NO)','(W - O)','(ZO - NW)'};

for i = 1:length(rtkprof_data.naam)
    clear dum1 dum2 dum3
    dum1 = rtkprof_data.X{i};
    dum2 = rtkprof_data.Z{i};  
    dum3 = rtkprof_data.datum{i};
    figure
    subplot(2,1,1)
    for k = 1:length(ioi)
        j = ioi(k);
        if k == 1
            plot(dum1{j},dum2{j},'k-','LineWidth',1.0)        
            hold on
        elseif k == 2
            plot(dum1{j},dum2{j},'r-','LineWidth',1.0)        
            hold on            
        elseif k == 3
            plot(dum1{j},dum2{j},'b-','LineWidth',1.0)        
            hold on                        
        elseif k == 4
            plot(dum1{j},dum2{j},'g-','LineWidth',1.0)        
            hold on                            
        elseif k == 5
            plot(dum1{j},dum2{j},'m-','LineWidth',1.0)        
            hold on              
        elseif k == 6
            plot(dum1{j},dum2{j},'c-','LineWidth',1.0)        
            hold on              
        elseif k == 7
            plot(dum1{j},dum2{j},'k:','LineWidth',1.0)    
            hold on                          
        end
    end
    grid on
    if i == 1 | i == 2 | i == 3
        xlim([-400 400])
    end
    plot(xlim,[0 0],'k-')        
    if i == 3
        legend(datestr(dum3(ioi)),2)
        xlabel('positie langs profiel (m)')
    else
        legend(datestr(dum3(ioi)),1)
    end
    ylabel('z_b (m NAP)')    
    title([rtkprof_data.naam{i},' ',dirr{i}])
    saveas(gcf,['EPS\rtk_prof_',num2str(i,'%02.0f'),'.eps'],'psc2');
    saveas(gcf,['PNG\rtk_prof_',num2str(i,'%02.0f'),'.png']);    
end