フィルターのクリア

How to change labels in pde toolbox

19 ビュー (過去 30 日間)
Geovane Gomes
Geovane Gomes 2024 年 6 月 30 日 13:38
コメント済み: Umar 2024 年 6 月 30 日 15:28
Hello everyone,
Is it possible to change the labels when using the pde toolbox?
For example, make face labels correspond to the same faces as the solids below.
clear
files = unzip('wing.zip')
files = 1x2 cell array
{'straight.STEP'} {'tappered.STEP'}
% geometry
g1 = importGeometry(files{1});
g1 = rotate(g1,90,[0 0 0],[1 0 0]);
g2 = importGeometry(files{2});
g2 = rotate(g2,90,[0 0 0],[1 0 0]);
% model
wing1 = createpde();
wing1.Geometry = g1;
pdegplot(wing1,"FaceLabels","on",FaceAlpha=0.5)
exportgraphics(gcf,'straight.png','Resolution',300)
wing2 = createpde();
wing2.Geometry = g2;
pdegplot(wing2,"FaceLabels","on",FaceAlpha=0.5)

回答 (1 件)

Umar
Umar 2024 年 6 月 30 日 14:50
Hi Geovane,
In the PDE Toolbox in MATLAB, you can change labels to correspond to faces of solids by utilizing the pdetool function. By setting the FaceLabels property to "on" in the pdegplot function, you can display face labels on the geometry plot. Additionally, you can customize the labels further by modifying the properties of the plot.
Here is an example code snippet demonstrating how to achieve this
% Create PDE model
model = createpde();
% Set geometry and plot with face labels
pdegplot(model, 'FaceLabels', 'on', 'FaceAlpha', 0.5);
% Export the plot
exportgraphics(gcf, 'geometry_with_labels.png', 'Resolution', 300);
By following these steps and customizing the plot properties, you can effectively change and display labels in the PDE Toolbox according to your requirements.
Hope this answers your question.
  2 件のコメント
Geovane Gomes
Geovane Gomes 2024 年 6 月 30 日 15:19
Hi Umar,
Thanks for answering.
It's not clear to me how do I change the labels, for example relabel the F3 face to F4.
Umar
Umar 2024 年 6 月 30 日 15:28
Hi Geovane,
If I recall and jog my memory correctly, you can use the set function to update the properties of the object.
For more information on this function, please refer to
https://www.mathworks.com/help/matlab/ref/set.html#
Hope this will help resolve your problem.

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

カテゴリ

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

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by