Error using barrier. Objective function is undefined at initial point. Fmincon cannot continue.
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anyone can give me an idea how to solve it? Running code as attach. Thank you very much.
0 commentaires
Réponses (1)
Alan Weiss
le 2 Mar 2018
Without examining your code, I can suggest the following:
Try to evaluate fun(x0), where fun is your objective function and x0 is your initial point. This will throw an error. Follow up the diagnostic information the error gives, or use the debugger to find out what is going wrong.
If you still have trouble after following those steps, feel free to ask again.
Alan Weiss
MATLAB mathematical toolbox documentation
1 commentaire
Matt J
le 28 Nov 2018
Sandeep's comment moved here:
This issue looks very complicated but thank you Alan for the hint to check function value at initial point. I got the same error "Objective function is undefined at initial point". I observed that while I was reading values from excel files, it is reading some empty cells and storing it as NaN format. I hence used NaN Filter "Z(isnan(Z)) = [ ]", for all the variables I am importing from excel. Problem is solved!
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!