Current function value: NaN

4 visualizaciones (últimos 30 días)
alpedhuez
alpedhuez el 3 de Ag. de 2020
Comentada: Uday Pradhan el 6 de Ag. de 2020
I use
options = optimset('PlotFcns',@optimplotfval);
[x,fval,exitflag,output] = fminbnd(fun,x1,x2,options)
to get information on fminbnd. Then. I get
"Current Function Value: NaN"
How can I fix this issue?
fval=-1.0029
exit flag=1
output = struct with fields:
iterations: 17
funcCount: 18
algorithm: 'golden section search, parabolic interpolation'
message: 'Optimization terminated:↵ the current x satisfies the termination criteria using OPTIONS.TolX of 1.000000e-04 ↵'
  1 comentario
Uday Pradhan
Uday Pradhan el 6 de Ag. de 2020
Hi,
You may want to describe what "fun" is and the lower and upper bounds too. In that way, you may get better responses. However, I would like to refer you to this link. You can check the last answer here which can be of help. In addition, you may also try to set stopping criteria of "fminbnd" to suit your needs (see link). Also, refer to the documentation of the respective functions that you use to implement them properly. In case you need to understand what operations produce NaN, see this.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Function Creation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by