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

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

[Octave-bug-tracker] [bug #65552] fminbnd can accept extra parameters to


From: Andy Adler
Subject: [Octave-bug-tracker] [bug #65552] fminbnd can accept extra parameters to functions in matlab
Date: Wed, 3 Apr 2024 08:54:10 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65552>

                 Summary: fminbnd can accept extra parameters to functions in
matlab
                   Group: GNU Octave
               Submitter: andy_adler
               Submitted: Wed 03 Apr 2024 12:54:09 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Undocumented Matlab
                  Status: None
             Assigned to: None
         Originator Name: Andy Adler
        Originator Email: 
             Open/Closed: Open
                 Release: 9.1.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 03 Apr 2024 12:54:09 PM UTC By: Andy Adler <andy_adler>
In matlab, fmin* functions accept an extra parameters to the functions
   fminbnd(@(x,a,b) sin(x+a+b),2,6,struct(),1,-2) 
(This is undocumented in current releases, but has been accepted for a long
time)

In order to support this in octave, we need the following patch:

:share/octave/9.1.0/m/optimization$ diff fminbnd.m fminbnd-old.m 
91c91
< function [x, fval, info, output] = fminbnd (fcn, a, b, options = struct (),
varargin = {})
---
> function [x, fval, info, output] = fminbnd (fcn, a, b, options = struct ())
123c123
<     fcn = @(x) guarded_eval (fcn, x, varargin{:});
---
>     fcn = @(x) guarded_eval (fcn, x);
135c135
<   fv = fw = fval = fcn (x, varargin{:});
---
>   fv = fw = fval = fcn (x);
202c202
<     fu = fcn (u, varargin{:});
---
>     fu = fcn (u);








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65552>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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