

close all;

[x1,y1] = pol2cart(lon,lat);

 plot (x1, y1, 'b');
hold on

a1 = x1(15:24);
b1 = y1(15:24);
plot (a1, b1, 'ro');
hold on
xi = x1(25:34);
yi = interp1(a1,b1,xi, 'previous','extrap');
plot (xi,yi,'b*');
plot(xi, y1(25:34), 'ko');
hold on
a2 = x1(65:75);
b2 = y1(65:75);
plot (a2, b2, 'go');
hold on
xi = x1(76:85);
yi = interp1(a2,b2,xi, 'next','extrap');
plot (xi,yi,'b*');
plot(xi, y1(76:85), 'ko');
hold on

a3 = x1(150:160);
b3 = y1(150:160);
plot (a3, b3, 'go');
hold on
xi = x1(160:170);
yi = interp1(a3,b3,xi, 'previous','extrap');
plot (xi,yi,'b*');
plot(xi, y1(160:170), 'ko');
hold on

a4 = x1(250:260);
b4 = y1(250:260);
plot (a4, b4, 'go');
hold on
xi = x1(260:270);
yi = interp1(a4,b4,xi, 'spline','extrap');
plot (xi,yi,'b*');
plot(xi, y1(260:270), 'ko');
hold on
