How to use pdeplot in appdesigner?

20 ビュー (過去 30 日間)
Andrew Ferguson
Andrew Ferguson 2021 年 2 月 25 日
コメント済み: Adolfo 2023 年 8 月 29 日 18:33
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:
Could anyone help me with this?

回答 (3 件)

Megumi Fukuda
Megumi Fukuda 2021 年 8 月 23 日
編集済み: Megumi Fukuda 2021 年 8 月 23 日
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 件のコメント
Pelajar UM
Pelajar UM 2022 年 2 月 28 日
@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;
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';
I keep getting "Unable to find a mesh".


mi li
mi li 2023 年 6 月 6 日
I find a solution,we can copy the date of pdegplot() to app.UIAxes:
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]);
% 关闭图形窗口
  1 件のコメント
Adolfo 2023 年 8 月 29 日 18:33
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:


Rashed Mohammed
Rashed Mohammed 2021 年 3 月 5 日
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


Help Center および File ExchangeGeneral PDEs についてさらに検索


Community Treasure Hunt

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

Start Hunting!

Translated by