![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/398844/image.png)
Copy an independant figure to panel in app designer
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Michele Giordano
el 31 de Oct. de 2020
Comentada: Michele Giordano
el 1 de Nov. de 2020
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/398699/image.jpeg)
0 comentarios
Respuesta aceptada
Adam Danz
el 31 de Oct. de 2020
Editada: Adam Danz
el 31 de Oct. de 2020
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/398844/image.png)
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Antenna Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!