필터 지우기
필터 지우기

Copy an independant figure to panel in app designer

조회 수: 11 (최근 30일)
Michele Giordano
Michele Giordano 2020년 10월 31일
댓글: Michele Giordano 2020년 11월 1일
Hi guys,
i have a problem and i don't know how to solve this. I want to copy a graphics of an independant figure to a panel created in app designer.
I've tried with copyobj and it seemed to work but it won't show the dBi of an antenna's 3dpattern.
this is a part of my code:
antennaObject = design(dipole,app.FreqEditField.Value);
antennaObject.Length = app.Dipolelength;
antennaObject.Width = app.Dipolewidth;
plotFrequency = app.FreqEditField.Value;
pattern(antennaObject, plotFrequency)
ax = gca;
copyobj(ax,app.Panel)
delete(f1)
You can see it cannot save the dBi value from the left figure.
Thank you for your support.

채택된 답변

Adam Danz
Adam Danz 2020년 10월 31일
편집: Adam Danz 2020년 10월 31일
You have to copy all desired objects from the figure listed in the figure's "children" property.
Here's a demo that copies all objects from 'fig' (blue, regular figure) to 'uifig' (yellow, uifigure).
You probably only want some of the objects which you can select from fig.Children.
uifig = uifigure('Color',[1 1 .8])
fig = figure('color',[.8 1 1]);
ax = axes(fig);
plot(ax, magic(3))
legend(ax)
colorbar(ax)
copyobj(fig.Children, uifig)
  댓글 수: 1
Michele Giordano
Michele Giordano 2020년 11월 1일
Hi,
thank you so much for the aswer. I've menaged to resolve the problem.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Antenna Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by