> Hi Everyone, > > I'm doing surface fitting using MATLAB. It was done > using fit with the 'poly22' option. The equation of > the surface is shown below: > > zVal = p00 + p10 .* x + p01 .* y + p20 .* x.^2 + p11 > .* x .* y + p02 .* y.^2; > > I would like to know how the coefficients > p00,p10,p01,p20,p11,p02 are derived or calculated. > Even if its a simple surface fitting algorithm that > shows how to derive the coefficients, that will be > very helpful as well. > > Thank you.
If (x(i),y(j),zval(i,j)) are your measurement points, the coefficients are determined by minimizing the function F(p00,p10,p01,p20,p11,p02) = sum_i sum_j (zVal(i,j)-(p00 + p10*x(i) + p01*y(j) + p20*x(i)^2 + p11*x(i)*y(j) + p02*y(j)^2))^2 with respect to p00,p10,p01,p20,p11,p02.