pdeviz
R2026bCreate and plot PDE visualization object
Syntax
Description
pdeviz(
creates a MeshData,NodalData)PDEVisualization object and plots the data at the mesh nodes as
a surface plot. For details, see PDEVisualization Properties.
pdeviz(___, customizes
the plot appearance using one or more Name=Value)Name=Value arguments. Use
name-value arguments with any combination of arguments from the previous syntaxes.
pdeviz(figure,___) specifies the graphics container for
the PDEVisualization object. For example, you can plot the object in
Figure 3 by specifying pdeviz(figure(3), ___).
Examples
Use the pdeviz function to create a PDE visualization object and plot it. Change the properties of this object to interact with the resulting plot.
Create an femodel object for static structural analysis and include a beam geometry into the model.
model = femodel(AnalysisType="structuralStatic", ... Geometry="SquareBeam.stl");
Plot the geometry.
pdegplot(model.Geometry,FaceLabels="on",FaceAlpha=0.5)
Specify Young's modulus and Poisson's ratio.
model.MaterialProperties = ... materialProperties(PoissonsRatio=0.3, ... YoungsModulus=210E3);
Specify that face 6 is a fixed boundary.
model.FaceBC(6) = faceBC(Constraint="fixed");Specify the surface traction for face 5.
model.FaceLoad(5) = faceLoad(SurfaceTraction=[0;0;-2]);
Generate a mesh and solve the problem.
model = generateMesh(model); structuralresults = solve(model);
Call pdeviz with only the mesh data. This call creates a PDEVisualization object and plots the mesh.
v = pdeviz(structuralresults.Mesh)

v =
PDEVisualization with properties:
MeshData: [1×1 FEMesh]
NodalData: [0×1 double]
MeshVisible: on
Transparency: 1
Position: [0.1300 0.1130 0.6664 0.7960]
Units: 'normalized'
Show all properties
Update the plot by adding the von Mises stress as the NodalData property of the PDEVisualization object v. The plot now shows the von Mises stress and the mesh.
v.NodalData = structuralresults.VonMisesStress;
Update the plot by adding the displacement as the DeformationData property of the PDEVisualization object v. The plot shows the deformed shape with the von Mises stress.
v.DeformationData = structuralresults.Displacement;

Update the plot to hide the mesh.
v.MeshVisible = "off";
Update the plot to hide the axes.
v.AxesVisible = "off";
Input Arguments
Finite element mesh, specified as an FEMesh object.
Data at mesh nodes, specified as a column vector.
Data Types: double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: pdeviz(model.Mesh,results.NodalSolution,MeshVisible="on",DeformationData=results.Displacement)
Surface transparency, specified as a real number from 0 through
1. The default value 1 indicates no
transparency. The value 0 indicates complete transparency.
Data Types: double
Toggle to show mesh, specified as "on" or
"off", or as numeric or logical 1
(true) or 0 (false). A
value of "on" is equivalent to true, and
"off" is equivalent to false. Thus, you can
use the value of this argument as a logical value.
When plotting only the mesh, the default is "on". Otherwise,
the default is "off".
Data Types: char | string
Mesh deformation data, specified as one of the following:
An
FEStructobject with the propertiesux,uy, and, for a 3-D geometry,uzA structure array with the fields
ux,uy, and, for a 3-D geometry,uzA matrix with either two columns for a 2-D geometry or three columns for a 3-D geometry
Level of mesh deformation, specified as a nonnegative number. Use this name-value
argument together with DeformationData.
pdeviz computes the default value of
DeformationScaleFactor based on the mesh and the value of
DeformationData.
Data Types: double
Toggle to hide or show axes, specified as "on" or
"off", or as numeric or logical 1
(true) or 0 (false). A
value of "on" is equivalent to true, and
"off" is equivalent to false. Thus, you can
use the value of this argument as a logical value.
Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name.
Colorbar visibility, specified as "on" or
"off", or as numeric or logical 1
(true) or 0 (false). A
value of "on" is equivalent to true, and
"off" is equivalent to false. Thus, you can
use the value of this property as a logical value. The value is stored as an on/off
logical value of type matlab.lang.OnOffSwitchState.
Color limits, specified as a two-element vector of the form [min
max]. The color limits indicate the color data values that map to the
first and last colors in the colormap.
Chart title, specified as a character vector, cell array of character vectors, string array, or categorical array.
Example: "My Title Text"
To create a multi-line title, specify a cell array of character vectors or a string array. Each element in the array corresponds to a line of text.
Example: {"My","Title"};
If you specify the title as a categorical array, MATLAB® uses the values in the array, not the categories.
If you create the chart using tabular data, the default chart has an autogenerated
title. If you do not want a title, specify "".
Display the axes toolbar, specified as "on" or
"off", or as numeric or logical 1
(true) or 0 (false). A
value of "on" is equivalent to true, and
"off" is equivalent to false. Thus, you can
use the value of this property as a logical value. The value is stored as an on/off
logical value of type matlab.lang.OnOffSwitchState.
"on"— Display the toolbar."off"— Do not display the toolbar.
For more information about the axes toolbar, see Control Chart Interactivity.
Azimuth and elevation of view, specified as a two-element vector of the form
[azimuth elevation] defined in degree units. Alternatively, use
the view function to set the view.
Output Arguments
Visualization container, returned as a handle to the
PDEVisualization object. For details, see PDEVisualization Properties.
Version History
Introduced in R2021aDisplay or hide the axes toolbar by using the ToolbarVisible
argument. The axes toolbar is visible by default, but you can hide it by setting the
ToolbarVisible value to "off".
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)