How to use the RF PCB Toolbox's show function inside of a Matlab App?

2 次查看(过去 30 天)
I'm working with the RF PCB Toolbox and am creating a simple Matlab App like shown below:
The goal is when pressing the plot button it will change the figure and display the result generated by the "show()" function.
The show function by itself has an output that looks like this:
However, when I call the show function inside the callback for the Plot button it hijacks the entire UI window and deletes the buttons/knobs. I just want the show function plot to occupy the space where the empty plot in the app UI window occupies.
One of Matlab's App tutorial video shows an example using "scatter(app.UIAxes,x,y)" but there is no way I can find to do that with the show function.
I've also tried using "focus(app.UIAxes)" but it gives the error message "Undefined function 'focus' for input arguments of type 'matlab.ui.control.UIAxes'."
  1 个评论
Michael Ferguson
Michael Ferguson 2023-11-7
Happy to add any additional info if it might make the question easier to answer. I'm just confused if the show function has some sort of special implementation that doesn't allow it to be plotted to an axes (as opposed to a complete figure?)
Maybe it is possible to plot nested figures inside of a Matlab app?

请先登录,再进行评论。

回答(1 个)

Gowtham
Gowtham 2023-11-17
Hello Michael,
I understand you are trying to get the output of 'show()' from the RF PCB toolbox without affecting any buttons / knobs of the app.
It appears that directly capturing the output of 'show()' is not possible due to the default presence of axes, making it impractical to display it in an empty plot.
To overcome this issue, one potential solution is to create a 'figure' window before invoking the 'show()' function.
For a sample demonstration of the above process, kindly refer to the following code snippet:
% Button pushed function: PlotButton
function PlotButtonPushed(app, event)
figure;
inductor = spiralInductor;
show(inductor);
end
Below is the output of the executed code snippet:
Kindly refer to the following MATLAB Documentation for further information on how to use ‘show()’ and ‘figure’:
Hope it helps.
Best Regards,
Gowtham

类别

Help CenterFile Exchange 中查找有关 Get Started with RF PCB Toolbox 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by