How to show a polar plot (Azimuth Pattern - Antenna) in MATLAB App Designer?

9 visualizzazioni (ultimi 30 giorni)
I am trying to show a polar plot using MATLAB App Designer. I want the plot to be displayed in the app, rather than opening it in a new figure.
The function I want to plot is:
pattern(array,fc,-180:180,0,'PropagationSpeed',c,'Type','powerdb',...
'CoordinateSystem','polar');
I am currently using the UIAxes function, but the problem is that the coordinate system is not polar and hence, I am not able to display the pattern correctly.
The code I am using now is:
pattern(app.ArrayURA,app.f, -180:180,0,'PropagationSpeed',app.c,'Type','powerdb',...
'CoordinateSystem','polar','Weights',app.w);
h = gca;
app.UIAxes_3.XLabel = h.XLabel;
app.UIAxes_3.YLabel = h.YLabel;
app.UIAxes_3.Title = h.Title;
for ii = length(h.Children):-1:1
h.Children(ii).Parent = app.UIAxes_3;
end
close(gcf)
How can I show the plot using the polar coordinate system?

Risposta accettata

Kevin Holly
Kevin Holly il 3 Nov 2022
You can create a Panel and place the entire polaraxes in there with the following:
h = gca;
h.Parent = app.Panel;
close(gcf)
Please see app attached.
  2 Commenti
Roby Karan
Roby Karan il 3 Nov 2022
Thank you Kevin. I just want to ask you if there is a way of removing the background plot.
Kevin Holly
Kevin Holly il 3 Nov 2022
How was the background axes created? What it in the panel before hand? If so, you can delete it in App Designer.
If you have an Axes there for another purpose and want to make it invisible, you can use it's handle to make it invisible. If it is an uiaxes, you can use:
app.UIAxes.Visible = 'off'

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Polar Plots in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by