Simultaneously get output and plot using RF Propagation Toolbox functions
38 views (last 30 days)
Show older comments
Alex B
on 25 Oct 2024 at 22:03
Commented: Alex B
on 29 Oct 2024 at 19:35
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 at 7:07
By the way: the call is
link(rx1, tx1)
rather than
link(tx1, rx1)
Accepted Answer
Piyush Kumar
on 26 Oct 2024 at 5:50
As per the documentation for the link function, there are 2 different ways of calling the same function to display the plot and return the success status, one with capturing the return value and one without capturing the return value in a variable. Unfortunately, I could not find a single function that can achieve both.
However, to close all the open siteviewers, you can use -
close all force
More Answers (1)
Walter Roberson
on 26 Oct 2024 at 7:02
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.
See Also
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!