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

6 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Kevin Holly
Kevin Holly am 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 Kommentare
Roby Karan
Roby Karan am 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 am 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'

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Polar Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by