Back to Data Visualization

mesh

3-D wireframe mesh surface

Syntax

mesh(Z)
mesh(X, Y, Z)
mesh(X, Y, Z, C)

Description

Creates a 3D wireframe mesh surface plot. With one argument, Z provides the heights with X and Y auto-generated as indices. With three arguments, X, Y, and Z define the surface coordinates. The optional C argument provides a color matrix.

Parameters

NameDescription
X(optional)X-coordinate matrix (auto-generated if omitted)
Y(optional)Y-coordinate matrix (auto-generated if omitted)
ZHeight matrix (required)
C(optional)Color data matrix (defaults to Z)

Returns

null (renders 3D chart inline)

Examples

Try It
>> [X, Y] = meshgrid(-2:0.2:2);
Z = X .* exp(-X.^2 - Y.^2);
mesh(X, Y, Z)

See Also