Date: Feb 28, 2013 4:09 AM
Author: kees de kapper
Subject: Curve fitting toolbox (Failure in initial user-supplied objective function evaluation)

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.