surfc
Surface plot of a function of two variable with a contour plot of the surface.
surfc(z)
surfc(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.

Each region defined by x[i,j]<=x<=x[i,j+1], y[i,j]<=y<=y[i+1,j] is filled with the same color, which is determined by the average z value in this region. Further, the boundaries of of each of these regions are drawn in black.

The contour plot of the function (lines along which the interpolated value of z is constant) is also drawn in the x-y plane.
Example
>>x=[0:.02:1]'
>>y=x
>>z=sin(x*pi)*cos(2*x'*pi)
>>surfc(x,y,z)
>>title('Surface Plot with Contour')