Borrar filtros
Borrar filtros

Stl file pdegplot in App designer

10 visualizaciones (últimos 30 días)
Jigar
Jigar el 17 de Mayo de 2024
Editada: Cris LaPierre el 20 de Mayo de 2024
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 comentario
Cris LaPierre
Cris LaPierre el 17 de Mayo de 2024
What error are you getting? Please share all the red text.

Iniciar sesión para comentar.

Respuesta aceptada

Adam Danz
Adam Danz el 17 de Mayo de 2024
Editada: Adam Danz el 17 de Mayo de 2024
> 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 comentarios
Jigar
Jigar el 19 de Mayo de 2024
Editada: Jigar el 19 de Mayo de 2024
editing
I take my words back. It is working with an app property. Thanks for all the help!
Adam Danz
Adam Danz el 20 de Mayo de 2024
Glad that it all worked out, thanks for the demo @Cris LaPierre!

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by