Simultaneously get output and plot using RF Propagation Toolbox functions
34 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Piyush Kumar
2024-10-26,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
Walter Roberson
2024-10-26,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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 RF Propagation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!