| Mapping Toolbox™ | ![]() |
dist = stdist(lat,lon)
dist = stdist(lat,lon,units)
dist = stdist(lat,lon,ellipsoid)
dist = stdist(lat,lon,ellipsoid,units,method)
dist = stdist(lat,lon) returns a row vector of the latitude and longitude geographic standard distance for the data points specified by the columns of lat and lon.
dist = stdist(lat,lon,units) indicates the angular units of the data. When the standard angle string units is omitted, 'degrees' is assumed. Output measurements are in terms of these units (as arc length distance).
dist = stdist(lat,lon,ellipsoid) specifies the elliptical definition of the Earth to be used with the two-element ellipsoid vector. The default ellipsoid model is a spherical Earth, which is sufficient for most applications. Output measurements are in terms of the distance units of the ellipsoid vector.
dist = stdist(lat,lon,ellipsoid,units,method) specifies the method of calculating the standard distance of the data. The default, 'linear', is simply the average great circle distance of the data points from the centroid. Using 'quadratic' results in the square root of the average of the squared distances, and 'cubic' results in the cube root of the average of the cubed distances.
The function stdm provides independent standard deviations in latitude and longitude of data points. stdist provides a means of examining data scatter that does not separate these components. The result is a standard distance, which can be interpreted as a measure of the scatter in the great circle distance of the data points from the centroid as returned by meanm.
The output distance can be thought of as the radius of a circle centered on the geographic mean position, which gives a measure of the spread of the data.
Create latitude and longitude lists using the worldcities data set and obtain standard distance deviation for group (compare with the example for stdm):
cities = shaperead('worldcities.shp', 'UseGeoCoords', true);
Paris = strmatch('Paris',{cities(:).Name});
London = strmatch('London',{cities(:).Name});
Rome = strmatch('Rome',{cities(:).Name});
Madrid = strmatch('Madrid',{cities(:).Name});
Berlin = strmatch('Berlin',{cities(:).Name});
Athens = strmatch('Athens',{cities(:).Name});
lat = [cities(Paris).Lat cities(London).Lat...
cities(Rome).Lat cities(Madrid).Lat...
cities(Berlin).Lat cities(Athens).Lat]
lon = [cities(Paris).Lon cities(London).Lon...
cities(Rome).Lon cities(Madrid).Lon...
cities(Berlin).Lon cities(Athens).Lon]
dist =stdist(lat,lon)
lat =
48.8708 51.5188 41.9260 40.4312 52.4257 38.0164
lon =
2.4131 -0.1300 12.4951 -3.6788 13.0802 23.5183
dist =
8.1827![]() | spzerom | stdm | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |