How to use the RF PCB Toolbox's show function inside of a Matlab App?
Afficher commentaires plus anciens
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 commentaire
Michael Ferguson
le 7 Nov 2023
Réponses (1)
Gowtham
le 17 Nov 2023
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’:
- https://www.mathworks.com/help/rfpcb/ref/show.html
- https://www.mathworks.com/help/matlab/ref/figure.html
Hope it helps.
Best Regards,
Gowtham
Catégories
En savoir plus sur Historical Contests dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!