Failure in initial objective function evaluation. FMINCON cannot continue
1 view (last 30 days)
Show older comments
Hi!
Im trying to solve a optimization problem with non linear constraints using fmincon.
This is my function that I want to minimize:
F1 = @(x)L1'.*(x);
L1 is a previously defined vector.
This is how I use fmincon:
options = optimset('GradObj','off','GradConstr','off','Display','iter','Diagnostics','on');
A = [];
B = [];
Aeq = [];
Beq = [];
LB = [];
UB = [];
x = fmincon(@(x) F1(x,L1),X0,A,B,Aeq,Beq,LB,UB,@(x) mynonlcon(x,a,b,epsilon),options)
Where mynonlcon is a function file containing my non linear constraints c and ceq.
I get the error:
Error in fmincon (line 546)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in HA3_test_2 (line 102)
x = fmincon(@(x) F1(x,L1),X0,A,B,Aeq,Beq,LB,UB,@(x) mynonlcon(x,a,b,epsilon),options)
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.
So my question is, what am I doing wrong? I cant seem to get past this problem.
I've never used fmincon before so I basically have no idea what I need to do to figure this out.
0 Comments
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!