

NWCUSP=gcwaypts(-21.816000000,114.166000000,-18.150000000,178.444000000,100);
VTXUSP=gcwaypts(8.387000000,77.753000000,-18.150000000,178.444000000,100);
NPMUSP=gcwaypts(21.42,-158.154,-18.150000000,178.444000000,100);
NLKUSP=gcwaypts(48.203,-121.917,-18.150000000,178.444000000,100);
NAAUSP=gcwaypts(44.646,-67.281,-18.150000000,178.444000000,100);

PAMT=load('Pam_track_NOAA_mat.txt');
T=datenum(PAMT(:,1),PAMT(:,2),PAMT(:,3),PAMT(:,4),PAMT(:,4)*0,PAMT(:,4)*0);
for i=1:size(PAMT,1)
    [PAMT(i,7),I]=min(6371*pi/180*distance(NWCUSP(:,1),NWCUSP(:,2),PAMT(i,5),PAMT(i,6)));
    if (I==101)
        PAMT(i,7)=0/0;
    end     
end

for i=1:size(PAMT,1)
    [PAMT(i,8),I]=min(6371*pi/180*distance(VTXUSP(:,1),VTXUSP(:,2),PAMT(i,5),PAMT(i,6)));
    if (I==101)
        PAMT(i,8)=0/0;
    end     
end

for i=1:size(PAMT,1)
    [PAMT(i,9),I]=min(6371*pi/180*distance(NPMUSP(:,1),NPMUSP(:,2),PAMT(i,5),PAMT(i,6)));
    if (I==101)
        PAMT(i,9)=0/0;
    end     
end

for i=1:size(PAMT,1)
    [PAMT(i,10),I]=min(6371*pi/180*distance(NLKUSP(:,1),NLKUSP(:,2),PAMT(i,5),PAMT(i,6)));
    if (I==101)
        PAMT(i,10)=0/0;
    end     
end

for i=1:size(PAMT,1)
    [PAMT(i,11),I]=min(6371*pi/180*distance(NAAUSP(:,1),NAAUSP(:,2),PAMT(i,5),PAMT(i,6)));
    if (I==101)
        PAMT(i,11)=0/0;
    end     
end

plot(T,PAMT(:,7:11),'LineWidth',5)
xlabel('Day/Time')
ylabel('Distance (km)')
set(gca,'FontSize',20);
datetick('x','DD/HH:MM')
legend('NWC','VTX','NPM','NLK','NAA');
