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: nonlineat fit
Replies: 5   Last Post: Oct 23, 2013 1:47 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,100
Registered: 6/7/07
Re: nonlineat fit
Posted: Oct 22, 2013 7:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 10/22/2013 5:31 PM, Mario Georgiou wrote:
...
...

> FUN
> =@(c,xdata)c(1).*xdata(:,1).^c(2).*xdata(:,2).^c(3).*xdata(:,3) ...

.^c(4).*xdata(:,4).^c(5).*xdata(:,5).^c(6).*xdata(:,6);
...

> %initial guess
> x0=[0 0 0 0 1];
>
> %run the solver
> X= lsqcurvefit(FUN,x0,xdata,HTC
>
> when i try to run it's giving this error message:
>
> ??? Attempted to access c(6); index out of bounds because numel(c)=5.
>

...

x0 has only five elements for six coefficients -- you're one short.

--




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

[Privacy Policy] [Terms of Use]

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