Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Curve fitting function (fit) error

Asked by sepideh on 2 Nov 2012

I am using function "fit" to fit a surface to my data. I have a 3 dimentional data , z(x,y). I use the function as below: surfacefit=fit([x y],z,'polyll') I am sure both my x and y are column matrix and have the same dimension. But i get this error : Error using fit>iFit (line 133) Y must be a column vector.

Error in fit (line 109) [fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ...

0 Comments

sepideh

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 2 Nov 2012
surfacefit=fit([x(:), y(:)],z(:),'polyll') 

1 Comment

sepideh on 2 Nov 2012

Hi, thanks for the answer, but i still get the same error.

Walter Roberson

Contact us