bugGNU Octave - Bugs: bug #46807, Additional arguments to fmin*

 
 

bug #46807: Additional arguments to fmin*

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Mon 04 Jan 2016 10:22:30 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 05 Jan 2016 09:00:28 AM UTC, comment #7: 

No probs. It's kind of an ugly hack too.

Ceral Paquet <octavebugs>
Mon 04 Jan 2016 10:08:07 PM UTC, comment #6: 

I agree to jwe. Problem parameter passing is easily done using an anonymous function in both Octave and Matlab

See example 2+3 in the current Matlab documentation:

http://www.mathworks.com/help/matlab/ref/fminsearch.html

Kai Torben Ohlhus <siko1056>
Group Member
Mon 04 Jan 2016 07:14:00 PM UTC, comment #5: 

We've already decided that we don't care to support this behavior since it is no longer documented Matlab behavior.

The documentation you point to appears to be quite old.  It looks like someone put up an unauthorized copy of the Matlab docs on their own server and never removed it even thought appears to be at least a dozen years out of date.  It mentions R13, which according to https://en.wikipedia.org/wiki/MATLAB#Release_history is about 13 years old now.

John W. Eaton <jwe>
Group administrator
Mon 04 Jan 2016 02:43:11 PM UTC, comment #4: 

Sorry for making a meal of this...! I just noticed fzero and fsolve need the same treatment.


(file #35920)

Ceral Paquet <octavebugs>
Mon 04 Jan 2016 01:57:55 PM UTC, comment #3: 

OK well that one didn't work. Try again...


(file #35919)

Ceral Paquet <octavebugs>
Mon 04 Jan 2016 01:33:46 PM UTC, comment #2: 

I don't trust my patch file skills... but here's my first effort.



(file #35918)

Ceral Paquet <octavebugs>
Mon 04 Jan 2016 10:47:14 AM UTC, comment #1: 

Oops, his is a dupe of #41888 which looks like it is not happening. Apologies for the noise!

Ceral Paquet <octavebugs>
Mon 04 Jan 2016 10:22:30 AM UTC, original submission:  

Matlab supports additional arguments in fminsearch, fmnbnd, fminunc, etc. that get passed to the function.

There is documentation here but not on the current Matlab website.

http://www-rohan.sdsu.edu/doc/matlab/techdoc/ref/fminsearch.html

Example:

# Octave
fun=@(x,C)sin(C*x);
fminsearch(fun,0,[],2)
error: Invalid call to fminsearch.  Correct usage is:

 -- Function File: X = fminsearch (FUN, X0)
 -- Function File: X = fminsearch (FUN, X0, OPTIONS)
 -- Function File: [X, FVAL] = fminsearch (...)


#Matlab
fun=@(x,C)sin(C*x);
fminsearch(fun,0,[],2)
ans =
   -0.7854


Ceral Paquet <octavebugs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #35920:  fmin.patch added by octavebugs (8KiB - text/x-patch)
file #35919:  fmin.patch added by octavebugs (5KiB - text/x-patch)
file #35918:  fmin.patch added by octavebugs (5KiB - text/x-patch)

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by octavebugs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-03 mmuetzel Dependencies- bugs #65552 is dependent
    2019-12-19 siko1056 Dependencies- bugs #57446 is dependent
    2019-02-20 mtmiller Dependencies- bugs #55742 is dependent
    2016-01-05 siko1056 Open/ClosedOpen Closed
    2016-01-04 siko1056 StatusNone Wont Fix
        Operating SystemGNU/Linux Any
    2016-01-04 octavebugs Attached File- Added fmin.patch, #35920
    2016-01-04 octavebugs Attached File- Added fmin.patch, #35919
    2016-01-04 octavebugs Attached File- Added fmin.patch, #35918

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code