Error using barrier Objective function is undefined at initial point. Fmincon cannot continue.
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi! I'm new to Matlab and run into this problem:
When I try to run the code I received I receive following error message for computePortfolio.m:
Error using barrier
Objective function is undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 848)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in computePortfolio (line 44)
fmincon(@fun, parameters.start, A, B, Aeq, Beq, parameters.lowerbound, parameters.upperbound,
[], options);
I don't quite understand why I would get an error message for an internal function (fmincon). Help will be greatly appreciated!
0 comentarios
Respuestas (1)
Steven Lord
el 22 de Sept. de 2020
What values do you receive when you evaluate your objective function fun at the initial values in the start field of the parameters struct array? If any of the values in that output are NaN you need to determine why those NaN values are being computed.
It is not possible for us to help you determine why the NaN values are being computed without seeing the body of the fun function, which you have not provided.
0 comentarios
Ver también
Categorías
Más información sobre Nonlinear Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!