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

2 ビュー (過去 30 日間)
Michael Ferguson
Michael Ferguson 2023 年 11 月 7 日
回答済み: Gowtham 2023 年 11 月 17 日
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 Center および File ExchangeGet 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