fminunc with a one-variable function

Jonathan Stickel jjstickel at vcn.com
Fri Jul 24 15:24:18 CDT 2009


Jaroslav Hajek wrote:
> On Fri, Jul 24, 2009 at 7:34 PM, Jonathan Stickel<jjstickel at vcn.com> wrote:
>>
>> Jaroslav Hajek wrote:
>>> On Thu, Jul 23, 2009 at 5:32 PM, Jonathan Stickel<jjstickel at vcn.com>
>>> wrote:
>>>> I see the following when I use fminunc to minimize a function of just one
>>>> variable:
>>>>
>>>>  function F = theF(x)
>>>>  F = x.^2 + exp(x);
>>>>  endfunction
>>>>  x0 = 1;
>>>>  [xmin,fmin] = fminunc(@theF,x0)
>>>>
>>>> error: Invalid call to cholupdate.  Correct usage is:
>>>>
>>>>  -- Loadable Function: [R1, INFO] = cholupdate (R, U, OP)
>>>>
>>>>
>>>> I know that there are other minimization functions that can be used for
>>>> single-variable functions, but fminunc should work too.
>>>>
>>>> Thanks,
>>>> Jonathan
>>>>
>>> Please try
>>> http://hg.savannah.gnu.org/hgweb/octave/rev/5fcf008c7c41
>>>
>> OK, I managed to compile chol.cc (thanks to jwe) from the indicated
>> changeset and put it in my path:
>>
>> octave:6> which chol
>> `chol' is a function from the file
>> /Users/jstickel/programming/octave/local/chol.oct
>>
>> However, I still see the same error as reported above.
>>
> 
> Of course you do. The error was in cholupdate et al., so you need also
> to override the autoloads. Or just replace the chol.oct file in
> Octave's directory.
> 

OK, it works now (after replacing the installed chol.oct).

What is the algorithm used in this version of fminunc?  It might be nice 
to mention in the help text.

Thanks,
Jonathan


More information about the Bug-octave mailing list