フィルターのクリア

Stl file pdegplot in App designer

10 ビュー (過去 30 日間)
Jigar
Jigar 2024 年 5 月 17 日
編集済み: Cris LaPierre 2024 年 5 月 20 日
Hi,
I am looking for a solution to find names of the faces after importing the stl file. pdegplot command does that but how can I use it in App Designer. I am trying the command but it throws different error. Looked for a solution but it isn't available.
Is there any other command where i can use it to see name faces in the App designer so that i can use it to apply BC.
Thanks,
Jigar
  1 件のコメント
Cris LaPierre
Cris LaPierre 2024 年 5 月 17 日
What error are you getting? Please share all the red text.

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

採用された回答

Adam Danz
Adam Danz 2024 年 5 月 17 日
編集済み: Adam Danz 2024 年 5 月 17 日
> pdegplot command does that but how can I use it in App Designer?
pdegplot does not have an input argument or property to specify the parent axes. This often poses a propblem in AppDesigner and uifigures in general since the default HandleVisible property in uifigures is 'off'. This prevents pdegplot from finding the axes within the uifigure resulting in the generation of a new figure external to the app.
I suppose this is the problem you're running into.
This workaround describes how to temporarily make the app's axes accessible and current so that the pdegplot will add content to the existing axes.
Here's a quick example. See the previous link for details.
% Mimick an app
app.UIFigure = uifigure();
app.UIAxes = uiaxes(app.UIFigure);
% Change handle visibility
origState = app.UIFigure.HandleVisibility;
handleVisCleanup = onCleanup(@()set(app.UIFigure,'HandleVisibility',origState));
app.UIFigure.HandleVisibility = 'on';
% Make axes current
set(groot, 'CurrentFigure', app.UIFigure)
set(app.UIFigure,'CurrentAxes',app.UIAxes)
% Plot pdegplot
g = [2 1 1 1 1 1 1 1 1 4 4;
-1 -0.6 -0.5 -0.4 -0.5 0.4 0.5 0.6 0.5 -1 0.17;
1 -0.5 -0.4 -0.5 -0.6 0.5 0.6 0.5 0.4 0.17 1;
0 -0.25 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 0 -0.74;
0 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 -0.25 -0.74 0;
0 0 0 0 0 0 0 0 0 1 1;
1 1 1 1 1 1 1 1 1 0 0;
0 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0 0;
0 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 0 0;
0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 1 1;
0 0 0 0 0 0 0 0 0 0.75 0.75;
0 0 0 0 0 0 0 0 0 0 0];
pdegplot(g)
  10 件のコメント
Jigar
Jigar 2024 年 5 月 19 日
編集済み: Jigar 2024 年 5 月 19 日
editing
I take my words back. It is working with an app property. Thanks for all the help!
Adam Danz
Adam Danz 2024 年 5 月 20 日
Glad that it all worked out, thanks for the demo @Cris LaPierre!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by