"John D'Errico" <email@example.com> wrote in message <firstname.lastname@example.org>... > "G. Michael" <email@example.com> wrote in message <firstname.lastname@example.org>... > > 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.