How to add pdemesh plot into a matlab gui ?

5 ビュー (過去 30 日間)
Antonio Agüero Ramón-Llin
Antonio Agüero Ramón-Llin 2025 年 3 月 5 日
コメント済み: Cris LaPierre 2025 年 3 月 6 日
How to add pdemesh plot into a matlab gui ?
pdemesh(app.UIAxes1,p,e,t);
doesn't work
mesh(app.UIAxes1,xq,yq,vq1) works
  1 件のコメント
Cris LaPierre
Cris LaPierre 2025 年 3 月 5 日
pdemesh does not accept a target axis as input; mesh does.
See this post for a possible workaround.

サインインしてコメントする。

採用された回答

Cris LaPierre
Cris LaPierre 2025 年 3 月 5 日
I was able to use this linked post to create a working example. My test app creates the pdemesh shown in this example.
Here is the corresponding ButtonPushed callback function that creates the plot.
% Button pushed function: Button
function ButtonPushed(app, event)
% These 2 lines will ensure that the original HandleVisibility
% values will be restored after this section runs. These lines
% are optional but recommended.
origState = app.UIFigure.HandleVisibility;
handleVisCleanup = onCleanup(@()set(app.UIFigure,'HandleVisibility',origState));
% Temporarily turn on the figure's HandleVisibility so the
% axes are detected by gca()
app.UIFigure.HandleVisibility = 'on';
% Set your app's axes to be current so gca() chooses the correct axes
set(groot, 'CurrentFigure', app.UIFigure)
set(app.UIFigure,'CurrentAxes',app.UIAxes)
% Call the external plotting function
[p,e,t] = initmesh("lshapeg");
pdemesh(p,e,t)
% This line is optional if your function ends here. It will run the
% restoration.
clear handleVisCleanup
end
  2 件のコメント
Antonio Agüero Ramón-Llin
Antonio Agüero Ramón-Llin 2025 年 3 月 6 日

Thank you Cris

Cris LaPierre
Cris LaPierre 2025 年 3 月 6 日
Thank you @Adam Danz!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeThermal Analysis についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by