### 17.3 Three-Dimensional Plotting

The Matlab-style three-dimensional plotting commands are:

— Function File: mesh (x, y, z)

> Plot a mesh given matrices x, and y from `meshdom` and a matrix z corresponding to the x and y coordinates of the mesh. If x and y are vectors, then a typical vertex is (x(j), y(i), z(i,j)). Thus, columns of z correspond to different x values and rows of z correspond to different y values.

> See also: meshgrid, contour.

— Function File: [xx, yy, zz] = meshgrid (x, y, z)
— Function File: [xx, yy] = meshgrid (x, y)
— Function File: [xx, yy] = meshgrid (x)

> Given vectors of x and y and z coordinates, and returning 3 arguments, return three dimensional arrays corresponding to the x, y, and z coordinates of a mesh. When returning only 2 arguments, return matrices corresponding to the x and y coordinates of a mesh. The rows of xx are copies of x, and the columns of yy are copies of y. If y is omitted, then it is assumed to be the same as x, and z is assumed the same as y.

> See also: mesh, contour.

— Function File: meshdom (x, y)

> Given vectors of x and y coordinates, return two matrices corresponding to the x and y coordinates of the mesh.

> Note: this function is provided for compatibility with older versions of Matlab. You should use `meshgrid` instead.