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

조회 수: 9 (최근 30일)
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?

채택된 답변

Kevin Holly
Kevin Holly 2022년 11월 3일
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
Roby Karan
Roby Karan 2022년 11월 3일
Thank you Kevin. I just want to ask you if there is a way of removing the background plot.
Kevin Holly
Kevin Holly 2022년 11월 3일
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'

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by