how to store the intermediate result when using fmincon
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
xueqi
el 30 de En. de 2013
Respondida: Daniel Frisch
el 7 de Oct. de 2020
Dear fellows, I am using fmincon to do optmization. Could you tell me how to look at and store the intermediate result when fmincon is trying different value? Well, I need to give an initial value for fmincon to start, and after that, it will try different value to find the optimized one. I want to check all those values that it tried and the corresponding results. Cheers
0 comentarios
Respuesta aceptada
Shashank Prasanna
el 30 de En. de 2013
You can use OutputFcn to access values at each iteration.
See the following link for more information:
In the optionset you can use the function as below:
options = optimset('OutputFcn',@outfun)
9 comentarios
Shashank Prasanna
el 5 de Feb. de 2013
Editada: Shashank Prasanna
el 5 de Feb. de 2013
I am not sure I follow you. I don't want the final output.
Just run your optimization and and even if it is stuck at an iteration, can you please paste what is on the screen? If you post it in the forum there may be other who may be able to help you better. If you don't provide enough information, no one will be able to help you.
Más respuestas (3)
Daniel Frisch
el 7 de Oct. de 2020
You can use my function outputFcn_global that saves all the intermediate results in a global variable, so you can inspect them later on.
0 comentarios
Ver también
Categorías
Más información sobre Data Import from MATLAB 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!