Two dimensional polynomial evaluation.
z = polyval2d(V,sx,sy)
If V is a matrix whose elements are the coefficients of a polynomial function of 2 variables, then polyval2d(V,sx,sy) is the value of the polynomial evaluated at [sx,sy]. Row numbers in V correspond to powers of x, while column numbers in V correspond to powers of y. If sx and sy are matrices or vectors,the polynomial function is evaluated at all points in [sx, sy].
If V is one dimensional, polyval2d returns the same result as polyval.
Use polyfit2d to generate appropriate polynomial matrices from f(x,y) data using a least squares method.