"107" wrote in message <mev3mf$27u$1@newscl01ah.mathworks.com>...
> bump.
>
> Maybe I need to give more details. I am using fmincon in the optimization tool and I am calling the objective and constraints function with a function handle. I tried using parenthesis to supply additional variables to the constraints function (different case of the same problem), but it doesn't work. It has to be possible.
x = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@(x)mycon(x,arg1,arg2,...,argn))
where mycon is a MATLAB function such as
function [c,ceq] = mycon(x,arg1,arg2,...,argn)
c = ... % Compute nonlinear inequalities at x.
ceq = ... % Compute nonlinear equalities at x.
arg : additional inputs supplied by the user (e.g.lookup tables)
Best wishes
Torsten.
> bump.
>
> Maybe I need to give more details. I am using fmincon in the optimization tool and I am calling the objective and constraints function with a function handle. I tried using parenthesis to supply additional variables to the constraints function (different case of the same problem), but it doesn't work. It has to be possible.
x = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@(x)mycon(x,arg1,arg2,...,argn))
where mycon is a MATLAB function such as
function [c,ceq] = mycon(x,arg1,arg2,...,argn)
c = ... % Compute nonlinear inequalities at x.
ceq = ... % Compute nonlinear equalities at x.
arg : additional inputs supplied by the user (e.g.lookup tables)
Best wishes
Torsten.