Distance between sites
Create transmitter and receiver sites.
tx = txsite('Name','MathWorks','Latitude',42.3001,'Longitude',-71.3504); rx = rxsite('Name','Fenway Park','Latitude',42.3467,'Longitude',-71.0972);
Get the Euclidean distance in km between the sites.
dme = distance(tx,rx)
dme = 2.1504e+04
dkm = dme / 1000
dkm = 21.5038
Get the geodesic distance between the two sites.
dmg = distance(tx,rx,'geodesic')
dmg = 2.1504e+04
path— Measurement path type
Measurement path type, specified as one of the following:
'euclidean': Uses the shortest path through
space that connects the antenna center positions of the site 1
and site 2.
'geodesic': Uses the shortest path on the
surface of the earth that connects the latitude and longitude
locations of site 1 and site 2. This path uses Earth ellipsoid
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
'Map'— Map for surface data
siteviewerobject | terrain name
d— Distance between sites
Distance between sites, returned as M-by-N arrays in degrees. M is the number of sites in site 2 and N is the number of sites in site 1.