Friday, 27 September 2013

octave-optim: minimize function applied to only partial list of parameters

octave-optim: minimize function applied to only partial list of parameters

I'm trying to minimize a scalar function of two variables, but I only want
to minimize with respect to the first argument:
function val = f( x, y )
val = (y*x-1.2345)^2;
endfunction
I'd like to pass the value y=2.345 and minimize on x only.
[ xret, fval ] = minimize( @f, ['x'], ??? )
How do I pass y to the f() function, without minimizing on y also?

1 comment: