how to find the value fmincon is trying

1 visualización (últimos 30 días)
xueqi
xueqi el 26 de Nov. de 2013
Comentada: Walter Roberson el 26 de Nov. de 2013
Hi fellows,
I am using fmincon to find the minimum of function f. Sometimes it gets a value of f is NaN , so fmincon fails to converge. Do you know how to find what value that fmincon is trying when it gets f as NaN?

Respuestas (1)

Walter Roberson
Walter Roberson el 26 de Nov. de 2013
At the command prompt give the command
dbstop if infnan
and run. When it stops you can examine the parameters passed in to your function.
  2 comentarios
xueqi
xueqi el 26 de Nov. de 2013
Hey. Could you also tell me how to examine the parameters? I am not sure where to find them....
Walter Roberson
Walter Roberson el 26 de Nov. de 2013
Look at
whos
and look at the parameter names you gave when you wrote the function and ask to look at those parameters. "x" is pretty common for this purpose.

Iniciar sesión para comentar.

Categorías

Más información sobre Nonlinear Optimization 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