The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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
Posted: Feb 6, 2009 7:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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

Error in ==> test_main at 6
[x,resnorm] = lsqnonlin(@myfun,x0) % Invoke optimizer

what am I doing wrong?????

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.