Simultaneously get output and plot using RF Propagation Toolbox functions
Show older comments
A number of functions in the Antenna and RF Propagation Toolboxes (such as los and link) have a behavior where, when called with no output, they will draw onto an active siteviewer. However, when called with an output, they will no longer draw to the site viewer. An example code is below:
% define the antennas to use
tx1 = txsite("Latitude", 38.9859, "Longitude", -76.9426);
rx1 = rxsite("Latitude", 38.98225, "Longitude", -76.941375);
siteviewer()
status = link(tx1,rx1) % the site viewer should not update to show the link
siteviewer()
link(tx1,rx1) % this should cause the 2nd site viewer to zoom in & draw the link
This snippet should create two siteviewers: one zoomed in with the link shown and another without the link. Is there any way to have a single funciton call return both the status and draw the link?
As a different-but-related quesiton, siteviewers are not closed by calling
close all
whats the best way to have a script close all open siteviewers at the start of execution? My script needs to open a new one for each simulation and I don't want all the old siteviewers just sitting around.
This question is marked as 2024b since that's the version I'm running, but it is a consistent problem on every version I've used these functions in.
1 Comment
Walter Roberson
on 26 Oct 2024
By the way: the call is
link(rx1, tx1)
rather than
link(tx1, rx1)
Accepted Answer
More Answers (1)
Walter Roberson
on 26 Oct 2024
0 votes
link() has internal code the is different when called with no outputs compared to one output. The code for no outputs calls a few internal routines for validating coordinates, and later creates plots and shows the rx and tx positions on the plot, and does other plotting work as well.
There is no option for graph output at the same time as calling with an output.
Categories
Find more on RF Propagation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!