How to use pdeplot in appdesigner?

4 visualizaciones (últimos 30 días)
Andrew Ferguson
Andrew Ferguson el 25 de Feb. de 2021
Comentada: ciming zhu el 11 de Mzo. de 2024
I'm trying to display a pdeplot graph in appdesigner, but I have no idea how to get it do display using app.UIAxes. Right now my pdeplot code is:
pdeplot(model2,'XYData',sol2(:,3600))
Could anyone help me with this?

Respuestas (3)

mi li
mi li el 6 de Jun. de 2023
I find a solution,we can copy the date of pdegplot() to app.UIAxes:
pdegplot(model);%偏微分方程求解
hFig = gcf; % 获取当前图形窗口的句柄
hAx = gca; % 获取当前坐标系的句柄
% 复制绘图对象到 app.UIAxes
copyobj(allchild(hAx), app.UIAxes);
% ylim(app.UIAxes, [-80, 0]);
% xlim(app.UIAxes, [-80, 250]);
% zlim(app.UIAxes, [-80, 80]);
view(app.UIAxes,15,25);
% 关闭图形窗口
close(hFig);
  2 comentarios
Adolfo
Adolfo el 29 de Ag. de 2023
This worked great to clear this error I was getting:
"Error using uicontextmenu
Parent must be a Figure
Error in pdeplot (line 1186)
hc=colorbar(ax,'UIContextMenu',uicontextmenu(ax.Parent)); % Disable context menu "
when trying to plot in the app designer using:
pdeplot(app.UIAxes3,Model_TD_S,"XYData",Solution_CD_S.VonMisesStress)
ciming zhu
ciming zhu el 11 de Mzo. de 2024
感谢老铁,这个方法很有用

Iniciar sesión para comentar.


Rashed Mohammed
Rashed Mohammed el 5 de Mzo. de 2021
Hi Andrew
As of R2020b, pdeplot does not support taking axes objects as input parameter which is the case with other plot functions. I have brought this issue to the concerned people and it might be considered in any future release.
Hope this helps

Megumi Fukuda
Megumi Fukuda el 23 de Ag. de 2021
Editada: Megumi Fukuda el 23 de Ag. de 2021
A possible option is using pdeviz
Use "pdeviz(figure,___)" syntax to specify plot area in the app designer. The code should be something like this:
% you need to have yourmeshdata
v = pdeviz(app.RightPanel, yourmeshdata); %specify where to plot the data
v.NodalData = sol2(:,3600);
  1 comentario
Pelajar UM
Pelajar UM el 28 de Feb. de 2022
@Megumi Fukuda Thanks but how can I use pdeviz with a mesh that is generated elsewhere?
With pdemesh, this is straightforward:
nodes = app.UITable2.Data;
elements = app.UITable.Data;
pdemesh(nodes',elements');
pdeviz on the other hand doesn't seem to allow you to do this....
pde.FEMesh.Nodes = app.UITable2.Data';
pde.FEMesh.Elements = app.UITable.Data';
pdeviz(pde.FEMesh);
I keep getting "Unable to find a mesh".

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by