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: lsqnonlin
Replies: 2   Last Post: Feb 6, 2009 11:10 PM

Advanced Search

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

Posts: 13
Registered: 10/27/06
Re: lsqnonlin
Posted: Feb 6, 2009 11:10 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gmiktq$t0n$1@fred.mathworks.com>...
> "G. Michael" <hovg@chevron.com> wrote in message <gmijoa$rfi$1@fred.mathworks.com>...
> > When I try the example in the docs;
> >
> > First, write an M-file to compute the k-component vector F.
> >
> > function F = myfun(x)
> > k = 1:10;
> > F = 2 + 2*k-exp(k*x(1))-exp(k*x(2));
> >
> > Next, invoke an optimization routine.
> >
> > x0 = [0.3 0.4] % Starting guess
> > [x,resnorm] = lsqnonlin(@myfun,x0) % Invoke optimizer
> >
> > I get:
> >
> > ??? Undefined function or method 'lsqnonlin' for input arguments of type
> > 'function_handle'.
> >
> > Error in ==> test_main at 6
> > [x,resnorm] = lsqnonlin(@myfun,x0) % Invoke optimizer
> >
> > what am I doing wrong?????

>
> Start with the obvious. Do you have the
> optimization toolbox? Is it on your search
> path? (Hey, I skipped over the very first
> question I might have asked: Is your
> computer plugged in?)
>
> John


Yes the computer is turned on and optim, optimdemos and optimlib are in the search path.
My original code that used lsqnonlin worked fine in R2007, R2008b is now on my new Vista system and lsqnonlin no longer works. That is why I tried the simple test.



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.