Error in passing extra parameters in constraints with Fmincon
1 view (last 30 days)
Show older comments
Hi,
I was trying to pass extra parameters to the constraint when using fmincon function. But it always ended up with an error message saying "Too many output arguments." I am really puzzled...
Thanks in advance.
Tim
obj=@(x) -x(10);
x_ini=ones(9,1); x_ini(10)=0;
lb=[1; 1; 0;0;0; 0; 0;0;0; -Inf];
ub=[Inf ; Inf; Inf ; Inf; Inf ; 1; Inf; Inf ; Inf; Inf ];
options = optimset('Largescale','off','Display','iter');
nonlcon =@(x) opt_cons(x, tar_nodeficit , vata_nodeficit , inct_nodeficit , wL_nodeficit, D_nodeficit, t_share_nodeficit ,N,sigma,theta,eta);
x= fmincon(obj, x_ini, [],[],[],[],lb,ub,nonlcon);
The function opt_cons is specified and I have already give those extra parameters values.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!