Nonlinear constraint function is undefined at initial point. Fmincon cannot continue.
2 views (last 30 days)
Show older comments
"Nonlinear constraint function is undefined at initial point. Fmincon cannot continue." This is my error. But i've tried to run my nonlinear constraint function at x0. Nothing wrong happened. How could it be???
3 Comments
Torsten
on 18 Oct 2023
Edited: Torsten
on 18 Oct 2023
how did you solve the problem?
I guess by avoiding that the constraint function returns NaN values for the initial guess x0 you provide.
Before calling "fmincon", test what the constraint function returns for your x0 vector by calling it:
[c,ceq] = constraint_function(x0)
where "constraint_function" stands for the name of your constraint function ("nonlcon" in the documentation).
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!