FMINCON - Failure in initial objective function evaluation. FMINCON cannot continue.
11 views (last 30 days)
Show older comments
I am trying to minimise a self-written objective function, called S_min, subject to simple linear inequality constraints. Since S_max is a function of 5 arguments but I only want to optimise over the first 2, I use a function handle:
fun = @(x,y) S_min(x,y,2,MU1,P_max); % MU1, P_max defined above [not shown]
And then implement the optimisation through:
fmincon(fun, [0.5,6], A ,B); % A, B defined above [not shown]
I checked that fun(0.5,6), i.e. evaluated at the starting values, gives a correct, scalar, answer; and that the vector [0.5,6] satisfies inequality constraints, i.e. A.*[0.5,6]<=B.
However, when trying to minimise as above, I get the following error message:
"Error in fmincon (line 536) [...]
Failure in initial objective function evaluation. FMINCON cannot continue."
This is surprising as the function should evaluate correctly at this point.
Is there anything I can do to fix this?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!