link
Display or compute communication link status
Description
link(___,
displays a communication link using additional options specified by
Name,Value
)Name,Value
pairs.
returns
the success status of the communication link as status
= link(___)true
or
false
.
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 pressing Ctrl and left-clicking and dragging.
Input Arguments
rx
— Receiver site
rxsite
object | array of rxsite
objects
Receiver site, specified as a rxsite
object. You can use array inputs to
specify multiple sites.
tx
— Transmitter site
txsite
object | array of txsite
objects
Transmitter site, specified as a txsite
object. You can use array inputs to
specify multiple sites.
propmodel
— Propagation model to use for path loss calculations
"longley-rice"
(default) | "freespace"
| "close-in"
| "rain"
| "gas"
| "fog"
| "raytracing"
| propagation model created using propagationModel
Propagation model to use for the path loss calculations, specified as one of these options:
"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) method. When you specify a ray tracing model as input, the function incorporates multipath interference by using a phasor sum.A propagation model created using the
propagationModel
function. For example, you can create a ray tracing propagation model that uses the image method by specifyingpropagationModel("raytracing","Method","image")
.
The default value depends on the coordinate system used by the input sites.
Coordinate System | Default propagation model value |
---|---|
"geographic" |
|
"cartesian" |
|
Terrain propagation models, including "longley-rice"
and
"tirem"
, are only supported for sites with a
CoordinateSystem
value of
"geographic"
.
You can also specify the propagation model by using the
PropagationModel
name-value pair argument.
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: "Type","power"
PropagationModel
— Propagation model to use for path loss calculations
"freespace"
| "close-in"
| "rain"
| "gas"
| "fog"
| "longley-rice"
| "raytracing"
| propagation model created using propagationModel
Propagation model to use for the path loss calculations, specified as one of these options:
"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) method. When you specify a ray tracing model as input, the function incorporates multipath interference by using a phasor sum.A propagation model created using the
propagationModel
function. For example, you can create a ray tracing propagation model that uses the image method by specifyingpropagationModel("raytracing","Method","image")
.
The default value depends on the coordinate system used by the input sites.
Coordinate System | Default propagation model value |
---|---|
"geographic" |
|
"cartesian" |
|
Terrain propagation models, including "longley-rice"
and
"tirem"
, are only supported for sites with a
CoordinateSystem
value of
"geographic"
.
Data Types: char
| string
SuccessColor
— Color of successful links
"green"
(default) | RGB triplet | character vector | string scalar
Color of successful links, specified as one of these options:
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
"red"
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 |
---|---|---|---|
"red" | "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
"red"
(default) | RGB triplet | character vector | string scalar
Color of unsuccessful links, specified as one of these options:
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
"red"
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 |
---|---|---|---|
"red" | "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 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
status
— Success status of communication link
M-by-N array
Success status of communication links, returned as an M-by-N arrays. M is the number of transmitter sites and N is the number of receiver sites.
Version History
Introduced in R2019bR2023b: Perform ray tracing analysis with multiple materials in the same scene
The link
function performs ray tracing analysis with multiple materials in the same scene when:
You create the scene from a glTF file, and specify the
propmodel
input argument as"raytracing"
or aRayTracing
propagation model object with itsSurfaceMaterial
property set to"auto"
(the default).You create the scene from an OpenStreetMap® file or a geospatial table, and you specify the
propmodel
input argument as"raytracing"
or aRayTracing
propagation model object with itsBuildingsMaterial
property set to"auto"
(the default).
The link
function performs the ray tracing analysis using the
materials stored in the file or table. If the file or table does not specify materials, or
if the file or table specifies a material that the ray tracing analysis does not support,
then the function uses concrete instead of the absent or unsupported material.
As a result, the link
function can return different values in
R2023b compared to previous releases. To avoid using the materials stored in the file or
table, create a RayTracing
object (by using the propagationModel
function) and set its SurfaceMaterial
property to
"plasterboard"
and its BuildingsMaterial
property to "concrete"
. Then, use the object as input to the
link
function.
R2023b: Ray tracing analysis with SBR method shows improved performance in complex scenes
The link
function shows improved performance with complex scenes when you specify a RayTracing
propagation model object that uses the shooting and bouncing rays (SBR) method as input.
The time that MATLAB® requires to perform ray tracing analysis depends on the scene and on the
properties of the RayTracing
object, such as the
AngularSeparation
, MaxNumDiffractions
,
MaxNumReflections
, MaxAbsolutePathLoss
, and
MaxRelativePathLoss
properties. In some cases, with moderate values
of the MaxAbsolutePathLoss
and MaxRelativePathLoss
properties, the ray tracing analysis can be more than 2x faster in R2023b than in
R2023a.
R2023a: Ray tracing models discard paths based on path loss
Ray tracing propagation models discard propagation paths based on path loss
thresholds. By default, when you specify the propmodel
input
argument as "raytracing"
or a RayTracing
object, the propagation model discards paths that are more than 40 dB weaker than
the strongest path.
As a result, the link
function can return different values in
R2023a compared to previous releases. To avoid discarding paths based on relative
path loss thresholds, create a RayTracing
object (by using the
propagationModel
function) and set its
MaxRelativePathLoss
property to Inf
.
Then, use the object as input to the link
function.
R2022b: Ray tracing functions consider multipath interference
When calculating received power using ray tracing models, the
link
function now incorporates multipath interference by
using a phasor sum. In previous releases, the function used a power sum. As a
result, the calculations in R2022b are more accurate than in previous
releases.
R2021b: "raytracing"
propagation models use SBR method
Starting in R2021b, when you use the link
function and
specify the propmodel
argument or
PropagationModel
name-value argument as
"raytracing"
, the function uses the shooting and bouncing
rays (SBR) method and calculates up to two reflections. In previous releases, the
link
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 the propagationModel
function. Then, use the link
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, see Choose 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, see Default modeling method is shooting and bouncing rays method.
See Also
sigstrength
| coverage
| sinr
| los
| propagationModel
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.
Select a Web Site
Choose a web site to get translated content where 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)