link
Display or compute communication link status
Description
link(___,
displays a communication link using additional options specified byName,Value
)Name,Value
pairs.
returns the success status of the communication link asstatus
= link(___)true
orfalse
.
Examples
Communication Link Between Geographic Transmitter and Receiver
Create a transmitter site.
tx = txsite("Name","MathWorks",..."Latitude",42.3001,..."Longitude",-71.3503);
Create a receiver site with a sensitivity defined in dBm.
rx = rxsite("Name","Boston",..."Latitude",42.3601,..."Longitude",-71.0589,..."ReceiverSensitivity",-90);
Plot the communication link between the transmitter and the receiver.
link(rx,tx)
Communication Link Between Cartesian Transmitter and Receiver
Import and view an STL file. The file models a small conference room with one table and four chairs.
viewer = siteviewer('SceneModel','conferenceroom.stl');
Create a transmitter site near the upper corner of the room and a receiver site above the table. Specify the position using Cartesian coordinates in meters.
tx = txsite('cartesian',...'AntennaPosition',[-1.46; -1.42; 2.1]); rx = rxsite('cartesian',...'AntennaPosition',[0.3; 0.3; 0.85]);
Plot the communication link between the transmitter and the receiver.
link(rx,tx)
Pan by left-clicking, zoom by right-clicking or by using the scroll wheel, and rotate the visualization by clicking the middle button and dragging or by pressingCtrland left-clicking and dragging.
Input Arguments
rx
—Receiver site
rxsite
object|array ofrxsite
对象
Receiver site, specified as arxsite
object. You can use array inputs to specify multiple sites.
tx
—Transmitter site
txsite
object|array oftxsite
对象
Transmitter site, specified as atxsite
object. You can use array inputs to specify multiple sites.
propmodel
—Propagation model
character vector|string|propagation model created withpropagationModel
Propagation model, specified as a character vector, a string, or a propagation model created with thepropagationModel
function. The default value depends on the coordinate system used by the input sites.
Coordinate System | Default propagation model value |
---|---|
'geographic' |
|
'cartesian' |
|
You can also specify the propagation model by using the'PropagationModel'
name-value pair argument.
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, whereName
is the argument name andValue
is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and encloseName
in quotes.
Example:'Type','power'
PropagationModel
—Propagation model to use for path loss calculations
'longley-rice'
(default) |'freespace'
|'close-in'
|'rain'
|'gas'
|'fog'
|'raytracing'
|propagation model created withpropagationModel
Propagation model to use for the path loss calculations, specified as the comma-separated pair consisting of'PropagationModel'
and one of the following:
'freespace'
— Free space propagation model'rain'
— Rain propagation model'gas'
— Gas propagation model'fog'
— Fog propagation model'close-in'
— Close-in propagation model'longley-rice'
— Longley-Rice propagation model'tirem'
— Tirem propagation model'raytracing'
— Ray tracing propagation model that uses the shooting and bouncing rays (SBR) methodA propagation model created with the
propagationModel
function
The default propagation model is'longley-rice'
when terrain is enabled and'freespace'
when terrain is disabled.
Terrain propagation models, including'longley-rice'
and'tirem'
, are only supported for sites with aCoordinateSystem
value of'geographic'
.
Data Types:char
SuccessColor
—Color of successful links
'green'
(default) |RGB triplet|character vector|string scalar
Color of successful links, specified as the comma-separated pair consisting of'SuccessColor'
and one of the following:
An RGB triplet whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1]
; for example,[0.4 0.6 0.7]
.A character vector such as
“红色”
or'r'
.A string scalar such as
"red"
or"r"
.
This table contains the color names and equivalent RGB triplets for some common colors.
Color Name | Short Name | RGB Triplet | Appearance |
---|---|---|---|
“红色” |
'r' |
[1 0 0] |
|
'green' |
'g' |
[0 1 0] |
|
'blue' |
'b' |
[0 0 1] |
|
'cyan' |
'c' |
[0 1 1] |
|
'magenta' |
'm' |
[1 0 1] |
|
'yellow' |
'y' |
[1 1 0] |
|
'black' |
'k' |
[0 0 0] |
|
'white' |
'w' |
[1 1 1] |
|
Data Types:char
|string
|double
FailColor
—Color of unsuccessful links
“红色”
(default) |RGB triplet|character vector|string scalar
Color of unsuccessful links, specified as the comma-separated pair consisting of'FailColor'
and one of the following:
An RGB triplet whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1]
; for example,[0.4 0.6 0.7]
.A character vector such as
“红色”
or'r'
.A string scalar such as
"red"
or"r"
.
This table contains the color names and equivalent RGB triplets for some common colors.
Color Name | Short Name | RGB Triplet | Appearance |
---|---|---|---|
“红色” |
'r' |
[1 0 0] |
|
'green' |
'g' |
[0 1 0] |
|
'blue' |
'b' |
[0 0 1] |
|
'cyan' |
'c' |
[0 1 1] |
|
'magenta' |
'm' |
[1 0 1] |
|
'yellow' |
'y' |
[1 1 0] |
|
'black' |
'k' |
[0 0 0] |
|
'white' |
'w' |
[1 1 1] |
|
Data Types:char
|string
|double
Map
—Map for visualization or surface data
siteviewer
object|triangulation
object|string scalar|character vector
Map for visualization or surface data, specified as asiteviewer
object, atriangulation
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' |
|
|
aAlignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®. |
Data Types:char
|string
Output Arguments
status
— Success status of communication link
M-by-Narray
Success status of communication links, returned as anM-by-Narrays.Mis the number of transmitter sites andNis the number of receiver sites.
Version History
Introduced in R2017bR2021b:'raytracing'
propagation models use SBR method
Behavior changed in R2021b
Starting in R2021b, when you use thelink
function and specify thepropmodel
argument orPropagationModel
name-value argument as'raytracing'
, the function uses the shooting and bouncing rays (SBR) method and calculates up to two reflections. In previous releases, thelink
function uses the image method and calculates up to one reflection.
To display or compute communication link status using the image method instead, create a propagation model by using thepropagationModel
function. Then, use thelink
function with the propagation model as input. This example shows how to update your code.
pm = propagationModel('raytracing','Method','image'); link(rx,tx,pm)
For information about the SBR and image methods, seeChoose a Propagation Model.
Starting in R2021b, all RF Propagation functions use the SBR method by default and calculate up to two reflections. For more information, seeDefault modeling method is shooting and bouncing rays method.
See Also
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
选择一个网站翻译内容的地方available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- 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)