Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

pdegplot

Plot PDE geometry

Plotting PDE geometries is the same for both the recommended and the legacy workflows.

Syntax

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

Description

example

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

example

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

h = pdegplot(___) returns handles to the graphics, using any of the previous syntaxes.

Examples

collapse all

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.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)

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

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

Import a 3-D geometry file. Plot the geometry and turn on face labels. To see the labels on all faces of the geometry, set the transparency to 0.5.

model = createpde;
importGeometry(model,'BracketWithHole.stl');
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)

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

model = createpde;
importGeometry(model,'DampingMounts.stl');
pdegplot(model,'CellLabels','on')

Input Arguments

collapse all

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: pdegplot(g,'FaceLabels','on')

The argument SubdomainLabels is not recommended. Use FaceLabels for both 2-D and 3-D geometries instead.

collapse all

Vertex labels for 2-D or 3-D geometry, specified as 'off' or 'on'.

Example: 'VertexLabels','on'

Data Types: char

Boundary edge labels for 2-D or 3-D geometry, specified as 'off' or 'on'.

Example: 'EdgeLabels','on'

Data Types: char

Boundary face labels for 2-D or 3-D geometry, specified as 'off' or 'on'.

Example: 'FaceLabels','on'

Data Types: char

Cell labels for 3-D geometry, specified as 'off' or 'on'.

Example: 'CellLabels','on'

Data Types: char

Surface transparency for 3-D geometry, specified as a real number from 0 through 1. The default value 1 indicates no transparency. The value 0 indicates complete transparency.

Example: 'FaceAlpha',0.5

Data Types: double

Output Arguments

collapse all

Handles to graphics objects, returned as a vector of handles.

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 face labels, select PDE > Show Subdomain Labels.

Introduced before R2006a

Was this topic helpful?