mesh
Mesh plot of a function of two variables.
mesh(z)
Mesh(x,y,z)
Inputs
z An mXn matrix of the function values to plot.
x Either a vector of length n or a matrix of size mXn .
y Either a vector of length m or a matrix of size mXn .


Description
The inputs x and y should either be both vectors, or matrices of the indicated size. In the former case, the function is assumed to be of the form z[i,j]=f(x[j], y[i]) . Otherwise, the functional form z[i,j]=f(x[i,j],y[i,j]) is assumed.

The mesh plot is drawn as a set of lines enclosing each of the regions bounded by the four points (x[i,j], y[i,j], z[i,j]) , (x[i+1,j], y[i+1,j], z[i+1,j]) , (x[i+1,j+1], y[i+1,j+1], z[i+1,j+1]) and (x[i,j+1], y[i,j+1], z[i,j+1]) .

The color of the lines is determined by the average value of z along each of the line segments.


Example
>>x=[0:.02:1]
>>y=x
>>z=sin(pi*x')*cos(2*pi*x)
>>mesh(x,x,z)