Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.
|
|
|
Re: lsqnonlin
Posted:
Feb 6, 2009 11:10 PM
|
|
"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.
|
|
|
|