|
|
Re: Curve fitting toolbox (Failure in initial user-supplied objective function evaluation)
Posted:
Feb 28, 2013 4:17 AM
|
|
Sorry, I just found it.
I've got two variables to be found, thus opts = fitoptions('Method','NonlinearLeastSquares', 'Startpoint',[0,0]);
kees
"kees de Kapper" <kees_de_kapper@hotmail.com> wrote in message <kgn6rj$6vv$1@newscl01ah.mathworks.com>... > Hi All, > > a very silly question I suppose. What am I doing wrong? > > X = (1:1829)'; > P = 0.01*(X-923).^2 + 0.03; > opts = fitoptions('Method','NonlinearLeastSquares', 'Startpoint',[0]); > f = fittype('a*(x-923).^2+b','options',opts); > [fmodel,gof] = fit(X, P, f); > > I get this error message: > ||||Error using fit>iFit (line 415) > ||||Not enough inputs to FITTYPE function. > |||| > ||||Error in fit (line 109) > ||||[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ... > |||| > ||||Caused by: > |||| Failure in initial user-supplied objective function evaluation. LSQCURVEFIT cannot continue. > |||| > ||||24 throwAsCaller( anException ); > > Many thanks in advance for your considerations.
|
|