distance
Distance between sites
Description
specifies options using name-value arguments.d = distance(___,Name=Value)
Examples
Create a transmitter site and a receiver site. Specify the locations using geographic coordinates.
tx = txsite(Name="MathWorks", ... Latitude=42.3001, ... Longitude=-71.3504); rx = rxsite(Name="Fenway Park", ... Latitude=42.3467, ... Longitude=-71.0972);
Calculate the distance between the sites. The function returns the result in meters. By default, the function calculates the distance using a Euclidean path.
dme = distance(tx,rx)
dme = 2.1504e+04
Convert the distance to kilometers.
dkm = dme / 1000
dkm = 21.5037
Create a transmitter site and a receiver site. Specify the locations using geographic coordinates.
tx = txsite(Name="MathWorks", ... Latitude=42.3001, ... Longitude=-71.3504); rx = rxsite(Name="Fenway Park", ... Latitude=42.3467, ... Longitude=-71.0972);
Calculate the distance between the sites using a great circle path. The function returns the result in meters. Convert the distance from meters to kilometers.
dme = distance(tx,rx,"greatcircle");
dkm = dme / 1000dkm = 21.4515
Input Arguments
Measurement path type, specified as one of the following:
"euclidean"— Use the shortest path through space that connects the antenna center positions of the sites. The option is the default for both Cartesian and geographic sites."greatcircle"— Use the shortest path on the surface of a spherical Earth that connects the geographic locations of the sites. This option requires theCoordinateSystemproperties of the sites to be"geographic".
Data Types: char
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: d = distance(site1,site2,Map="myfile.stl") specifies the
map as an STL file.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: d = distance(site1,site2,"Map","myfile.stl") specifies
the map as an STL file.
Map for visualization or surface data, specified as a siteviewer
object, a triangulation object, a string scalar, or a character vector.
Valid and default values depend on the coordinate system.
| Coordinate System | Valid map values | Default map value |
|---|---|---|
"geographic" |
|
|
"cartesian" |
|
|
a Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®. | ||
In most cases, if you specify this argument as a value other than a siteviewer or
"none", then you must also specify an output argument.
Data Types: char | string
Output Arguments
Version History
Introduced in R2017b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)