www.gusucode.com > map 案例源码 matlab代码程序 > map/InterpolateCoordinatesAtSpecificLocationsExample.m
%% Interpolate Coordinates at Specific Locations % This example shows how to interpolate coordinates at specific locations % using |intrplat| and |intrplon| functions. |intrplat| and |intrplon| % return one value at a time and give you control over the interpolation % method used. For more information, see the <docid:map_ref.f13-226541> and % <docid:map_ref.f13-222994> reference pages. %% % Define latitudes and longitudes. % Copyright 2015 The MathWorks, Inc. lat = [57 68 60 65 56]; lon = [1 3 4 9 13]; %% % Specify the longitude for which you want to compute a latitude. newlon = 7.3; %% Linear Interpolation % Generate a new latitude with linear interpolation. newlat = intrplat(lon,lat,newlon,'linear') %% Great Circle Interpolation % Generate a new latitude using great circle interpolation. newlat = intrplat(lon,lat,newlon,'gc') %% Rhumb Line Interpolation % Generate a new latitude using interpolation along a rhumb line. newlat = intrplat(lon,lat,newlon,'rh') %% % To see an illustration comparing these three interpolations, see % <docid:map_ug.f7-12305>.