Hello everyone, I'd like to use the lsfitlinear C++ function to fit a fourth order polynomial on my input data X=(x1,x2) that are in R^2.
I set the y vector to contain the N sample values (expermiental data) and the FMatrix (NxM) to contain the basis function that is the fourth order polynomial of each input sample. So a generic row of FMatrix is: [1, x1, x2, x1^2, x2^2, x1x2, x1^3, x2^3, x1x2^2, x2x1^2, x1^2x2^2, x1^3x2, x2x1^3, x1^4, x2^4].
The lsfitlinear() function returns ok but the coefficient vector contains all 0's.
Could anyone tell me if I'm wrongly setting the problem up?
Thanks!
|