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

New to MATLAB?

Curve fitting function (fit) error

Asked by sepideh

sepideh (view profile)

on 2 Nov 2012
Latest activity Commented on by Susarla

Susarla (view profile)

on 5 Feb 2015

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

sepideh (view profile)

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson

Walter Roberson (view profile)

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

2 Comments

sepideh

sepideh (view profile)

on 2 Nov 2012

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

Susarla

Susarla (view profile)

on 5 Feb 2015

Many Thanks for this answer

Walter Roberson

Walter Roberson (view profile)

Contact us