Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Distance Matrix Latitude Longitude 1.0

Date Added: May 26, 2013  |  Visits: 265

DISTMATLATLON Computes distance matrix between list of coords in X and Y D = DISTMATLATLON(X,Y) for matrices X and Y, with columns [Lat Lon], returns the distance matrix where the (i,j)th entry is the distance between the i'th and j'th row of X and Y respectively. X and Y must have columns in the form of [Lat Lon], but can be different in number of rows. [D,XI,YI]=DISTMATLATLON(X,Y,varargin) gives the indices of the sorted values of matrix D, depending on the inputs of varargin. (The n'th row of XI is the ordering of distance to each member of Y in relationship to X(n); similarly for YI. The ordering is specified by the user, see below) To compare a matrix with itself use DISTMATLATLON(X,X) Optional Parameters (in any order): ORDERING 'ascend' : Rank XI and YI in ascending order. (DEFAULT) 'descend' : Rank XI and YI in descending order. DISTANCE COMPUTATION 'gc' : Great Circle Distance (DEFAULT) 'rh' : Rhumb Line Distance UNITS OUTPUT 'km' : Kilometers (DEFAULT) 'nm' : Nautical Miles 'sm' : Statute Miles EXAMPLE: X is 3 major US cities representing DC, NYC, and LA Y is 2 major European cities representing London and Paris What is the distance between each city in X to each city in Y, in kilometers, and their ordering? X=[38.895, -77.037; 40.717, -74.000; 34.050, -118.250]; Y=[51.507, -00.128; 48.857, 02.351]; [D,XI,YI]=distmatlatlon(X,Y)

 Requirements: No special requirements Platforms: Matlab Keyword: 039km039,  039nm039,  039sm039,  Kilometers,  Miles,  Nautical,  Output,  Statute,  Units Users rating: 0/10