UMesh
, VMesh
, USubmesh
, VSubmesh
Number of sample points
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
UMesh , USubmesh , VMesh , VSubmesh  Inherited  Positive integer 
Objects  Default Values 

plot::Curve2d , plot::Curve3d , plot::Polar 

plot::Cylindrical , plot::Spherical , plot::Surface , plot::XRotate , plot::ZRotate 

plot::Rootlocus 

plot::Sweep 

plot::Plane 

plot::Tube 

plot::Ode2d , plot::Ode3d 

The attributes UMesh
etc. determine the number
of sample points used for the numerical approximation of parameterized
plot objects such as curves and surfaces.
Many plot objects have to be evaluated numerically on a discrete mesh. The attributes described on this help page serve for setting the number of sample points of the numerical mesh.
For curves in 2D and 3D given by a parametrization x(u), y(u) and,
possibly, z(u) with
the curve parameter u,
the attribute UMesh = n
creates a numerical mesh
of n equidistant u values.
The attribute USubmesh = m
inserts additional m mesh
points between each pair of adjacent points set by UMesh
.
The combinations UMesh = n
, USubmesh
= m
and UMesh = (m + 1) (n  1) + 1
, USubmesh
= 0
are equivalent.
Specifying Mesh
, Submesh
has the same
effekt as specifying UMesh
, USubmesh
.
The sample points of a curve can be made visible by setting PointsVisible
= TRUE
.
Surface objects in 3D are parameterized by coordinate functions x(u, v), y(u, v), z(u, v) of two surface parameters u, v.
The attribute UMesh = n_{u}
sets
the number n_{u} of
sample points for the first surface parameter. The attribute VMesh
= n_{v}
sets the number nv of
sample points for the second surface parameter. The parametrization
is evaluated on a regular mesh of n_{u}×n_{v} values
of the surface parameters u, v.
With the USubmesh
, VSubmesh
attributes,
additional equidistant sample points can be inserted between each
pair of adjacent sample points set by the UMesh
, VMesh
attributes.
With ULinesVisible = TRUE
and VLinesVisible
= TRUE
, respectively, the parameter lines of the regular
mesh set by the attributes UMesh
, VMesh
are
displayed on the surface. Additonal points inserted via USubmesh
, VSubmesh
do not create
additional parameter lines.
You can also specify UMesh = n_{u}
, VMesh
= n_{v}
, USubmesh = m_{u}
, VSubmesh
= m_{v}
in the shorter form Mesh
= [n_{u},
n_{v}]
, Submesh
= [m_{u},
m_{v}]
.
If adaptive sampling is
enabled, further nonequidistant sample points are chosen automatically
between the equidistant points of the `initial mesh' set via the UMesh,
USubmesh, VMesh, VSubmesh
attributes.
It is possible to use low settings of mesh parameters to achieve special effects. As an example, we draw a parametrization of a circle with just six evaluation points:
plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 6, Scaling = Constrained))
The reason we get a pentagon here and not a hexagon is that the first and the last evaluation points coincide: six points in a line means five line segments.
With UMesh = 30
, the circle looks like a
circle:
plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 30, Scaling = Constrained))
The default values of UMesh
, VMesh
do
not provide a sufficient resolution for the following graphics:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI)):
The spiral winds around the zaxis
5 times. We wish to have approximately 40 sample points per revolution,
so we need to use a total of 200 sample points with respect to the
angle parameter phi
. The coordinate lines related
to the radial parameter r
are straight lines, so
a very low resolution in this direction suffices:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 200)):
When refining the mesh via VSubmesh
, no additional
parameter lines are created:
plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 25, VSubmesh = 8)):