pdegplot

Plot PDE geometry

Syntax

pdegplot(g)
h = pdegplot(g)
h = pdegplot(g,Name,Value)

Description

pdegplot(g) plots the geometry of a PDE problem.

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

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

Input Arguments

g

Decomposed geometry matrix, as produced by decsg, or by selecting Boundary > Export Decomposed Geometry, Boundary Cond's from the PDE app. g can also be the name of a geometry file or a function handle to a geometry file (see wgeom for details).

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.

'edgeLabels'

'on' shows the label for each boundary edge. These are the same as the labels that the PDE app produces when you select Boundary > Show Edge Labels.

Default: 'off'

'subdomainLabels'

'on' shows the label for each subdomain. These are the same as the labels that the PDE app produces when you select PDE > Show Subdomain Labels.

Default: 'off'

Output Arguments

h

Vector of handles to the figure axes.

Examples

expand all

Plot 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.169101978725763;
1	-0.5	-0.45	-0.5	-0.55	0.5	0.55	0.5	0.45	0.169101978725763	1;
0	-0.25	-0.3	-0.25	-0.2	-0.25	-0.3	-0.25	-0.2	0	-0.739198919740117;
0	-0.3	-0.25	-0.2	-0.25	-0.3	-0.25	-0.2	-0.25	-0.739198919740117	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.

pdegplot(g,'edgeLabels','on','subdomainLabels','on')
ylim([-.8,.1]) % to see the top edge clearly

Alternatives

If you create the geometry in the PDE app, you can view the geometry from Boundary Mode. You can see the edge labels by selecting Boundary > Show Edge Labels, and you can see the subdomain labels by selecting PDE > Show Subdomain Labels.

See Also

| |

Was this topic helpful?