Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Curve fitting toolbox (Failure in initial user-supplied objective function evaluation)
Replies: 1   Last Post: Feb 28, 2013 4:17 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
kees de kapper

Posts: 77
Registered: 12/7/04
Re: Curve fitting toolbox (Failure in initial user-supplied objective function evaluation)
Posted: Feb 28, 2013 4:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Sorry, I just found it.

I've got two variables to be found, thus
opts = fitoptions('Method','NonlinearLeastSquares', 'Startpoint',[0,0]);


"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.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.