How can I plot the antenna array pattern/ the 3D pattern plot in MATLAB App Developer without plotting the figures in a new window?

I am trying to plot some figures in MATLAB App Designer such as the antenna pattern (rectangular and polar), the 3D array pattern, the array structure, etc. I want to plot the figures in the app, without opening them in a new window.
I am using functions such as:
  • pattern(app.ArrayURA,app.f,-180:180,-90:90,'PropagationSpeed',app.c,'Type','powerdb','CoordinateSystem','polar','Weights',app.w);
  • viewArray(app.ArrayURA,'ShowNormals',true,'ShowIndex','All');
  • plotSpectrum(app.estimator, 'NormalizeResponse', true);
How can I do so? I know that it is possible to use the UIAxes function, but how can you use it for a 3D plot or for the antenna array plot?

 采纳的回答

You can add the following as a workaround (See app attached for an example):
h = gca;
app.UIAxes.XLabel = h.XLabel;
app.UIAxes.YLabel = h.YLabel;
app.UIAxes.Title = h.Title;
for ii = length(h.Children):-1:1
h.Children(ii).Parent = app.UIAxes;
end
close(gcf)

4 个评论

Hi Kevin, thank you for your answer. I just want to ask you if it is also possible to plot the array structure and/or the 3D plot using this method.
For instance, how can I plot the array structure using the method you mentioned above? viewArray(app.ArrayURA,'ShowNormals',true,'ShowIndex','All');
Or, how can I show the 3D plot?
pattern(ura,fc,-180:180,-90:90,'PropagationSpeed',c,'Type','powerdb',...
'CoordinateSystem','rectangular','Weights',w);
Yes it is possible. See updated app attached. You can uncomment the line 28 to see the array structure.
I still have some issues with the polar plot. Is there a way to use the polar axes instead of the UIAxes?
I want to plot the following function:
pattern(array,fc,-180:180,0,'PropagationSpeed',c,'Type','powerdb',...
'CoordinateSystem','polar');
For instance, can I use: "pax = polaraxes(app.parent)"?

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with Antenna Toolbox 的更多信息

产品

版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by