| Mapping Toolbox™ | ![]() |
[latdev,londev] = stdm(lat,lon)
[latdev,londev] = stdm(lat,lon,ellipsoid)
[latdev,londev] = stdm(lat,lon,units)
[latdev,londev] = stdm(lat,lon) returns row vectors of the latitude and longitude geographic standard deviations for the data points specified by the columns of lat and lon.
[latdev,londev] = stdm(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.
[latdev,londev] = stdm(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).
If a single output argument is used, then geodevs = [latdev longdev]. This is particularly useful if the original lat and lon inputs are column vectors.
Determining the deviations of geographic data in latitude and longitude is more complicated than simple sum-of-squares deviations from the data averages. For latitude deviation, a straightforward angular standard deviation calculation is performed from the geographic mean as calculated by meanm. For longitudes, a similar calculation is performed based on data departure rather than on angular deviation. See Geographic Statistics in the Mapping Toolbox User's Guide.
Create latitude and longitude lists using the worldcities data set and obtain standard distance deviation for group (compare with the example for stdist):
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]
[latstd,lonstd]=stdm(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
latstd =
2.7640
lonstd =
68.7772departure, filterm, hista, histr, meanm, stdist
![]() | stdist | stem3m | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |