octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #41915] fminsearch: problem with anonymous fun


From: H. G.
Subject: [Octave-bug-tracker] [bug #41915] fminsearch: problem with anonymous function and options
Date: Thu, 20 Mar 2014 21:04:37 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0

URL:
  <http://savannah.gnu.org/bugs/?41915>

                 Summary: fminsearch: problem with anonymous function and
options
                 Project: GNU Octave
            Submitted by: hardy
            Submitted on: Do 20 Mär 2014 21:04:36 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: Any

    _______________________________________________________

Details:

Here is an example that shows the behavior:

* myfun.m contains:

function f = myfun(x,a)
f = x(1)^2 + a*x(2)^2;


* The demo script is:

param = 1.5;
options = optimset;
start = [1,3];
result = fminsearch (@(x) myfun(x, param),start,options)


Octave throws an error message: "error: parse_options: A(I) = X: X must have
the same size as I". 

In Matlab the very same script returns a useful result. Since I haven't found
where this usage of fminsearch violates its documented behavior, I've reported
this as "incorrect result" for now, but maybe I'm wrong.

Note: If you leave out the options, then the script runs totally fine in
Octave (as well as in Matlab), but obviously without your intended options:


param = 1.5;
options = optimset;
start = [1,3];
result = fminsearch (@(x) myfun(x, param),start)





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41915>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]