meanm
Mean location of geographic coordinates
Syntax
[latmean,lonmean] = meanm(lat,lon)
[latmean,lonmean] = meanm(lat,lon,units)
[latmean,lonmean] = meanm(lat,lon,ellipsoid)
Description
[latmean,lonmean] = meanm(lat,lon)
returns
row vectors of the geographic mean positions of the columns of the
input latitude and longitude points.
[latmean,lonmean] = meanm(lat,lon,units)
indicates the
angular units of the data. The default angle unit is
'degrees'
.
[latmean,lonmean] = meanm(lat,lon,ellipsoid)
specifies
the shape of the Earth using ellipsoid
, which can be a referenceSphere
, referenceEllipsoid
, or oblateSpheroid
object, or a vector of the form [semimajor_axis
eccentricity]
. The default ellipsoid model is a spherical Earth, which is
sufficient for most applications.
If a single output argument is used, then geomeans
= [latmean,longmean]
. This is particularly useful if the
original lat
and lon
inputs
are column vectors.
Background
Finding the mean position of geographic points is more complicated
than simply averaging the latitudes and longitudes. meanm
determines
mean position through three-dimensional vector addition. See Geographic Statistics for Point Locations on a Sphere in
the Mapping Toolbox User's Guide.