Documentation

pdegplot

Plot PDE geometry

Syntax

Description

example

pdegplot(g) plots the geometry of a PDE problem, as described in g.

h = pdegplot(g) returns handles to the figure axes.

example

h = pdegplot(g,Name,Value) plots with additional options specified by one or more Name,Value pair arguments.

Examples

collapse all

Plot 2-D Geometry

Plot the geometry of a region defined by a few simple shapes.

g = [2	1	1	1	1	1	1	1	1	4	4;
-1	-0.55	-0.5	-0.45	-0.5	0.45	0.5	0.55	0.5	-1	0.17;
1	-0.5	-0.45	-0.5	-0.55	0.5	0.55	0.5	0.45	0.17	1;
0	-0.25	-0.3	-0.25	-0.2	-0.25	-0.3	-0.25	-0.2	0	-0.74;
0	-0.3	-0.25	-0.2	-0.25	-0.3	-0.25	-0.2	-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.05	0.05	0.05	0.05	0.05	0.05	0.05	0.05	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)

View the edge labels and the subdomain label. Add space at the top of the plot to see the top edge clearly.

pdegplot(g,'EdgeLabels','on','SubdomainLabels','on')
ylim([-.8,.1])

Plot 3-D Geometry

Import a 3-D geometry file. Plot the geometry and turn on face labels.

model = createpde;
importGeometry(model,'BracketTwoHoles.stl');
pdegplot(model,'FaceLabels','on')

Related Examples

Input Arguments

collapse all

g — Geometry descriptionPDEModel object | output of decsg | decomposed geometry matrix | name of geometry file | function handle to geometry file

Geometry description, specified by one of the following:

Data Types: double | char | function_handle

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example:

'EdgeLabels' — Boundary edge labels of 2-D geometry'off' (default) | 'on'

Boundary edge labels of 2-D geometry, specified as the comma-separated pair consisting of 'EdgeLabels' and 'off' or 'on'.

Example: pdegplot(g,'EdgeLabels','on')

Data Types: char

'SubdomainLabels' — Subdomain labels of 2-D geometry'off' (default) | 'on'

Subdomain labels of 2-D geometry, specified as the comma-separated pair consisting of 'EdgeLabels' and 'off' or 'on'.

Example: pdegplot(g,'SubdomainLabels','on')

Data Types: char

'FaceLabels' — Boundary face labels of 3-D geometry'off' (default) | 'on'

Boundary face labels of 3-D geometry, specified as the comma-separated pair consisting of 'FaceLabels' and 'off' or 'on'.

Example: pdegplot(g,'FaceLabels','on')

Data Types: char

Output Arguments

collapse all

h — Handles to the figure axesvector

Handles to the figure axes, returned as a vector.

Alternative Functionality

App

If you create 2-D geometry in the PDE app, you can view the geometry from Boundary Mode. To see the edge labels, select Boundary > Show Edge Labels. To see the subdomain labels, select PDE > Show Subdomain Labels.

Introduced before R2006a

Was this topic helpful?