Making fmincon display function argument at each iteration

2 visualizaciones (últimos 30 días)
Matthieu
Matthieu el 8 de Nov. de 2013
Respondida: Ben Petschel el 12 de Nov. de 2013
Hello everyone,
I am using fmincon with parameter 'Display' at iter-detailed but there is something very useful that it still does not display: the argument of the function being minimised that resulted in the value for the iteration.
Is there any way to have this information ?

Respuestas (1)

Ben Petschel
Ben Petschel el 12 de Nov. de 2013
The utility PEEK on the file exchange can be used to tell you which points were evaluated during the minimization, e.g.
f = @(x)norm(x-1); % function to be minimised
fpeek = @(x)peek(f(x),x); % save the values of f(x) and x, returning f(x) as the first output
fminsearch(fpeek,[0,0]); % minimise 2d function starting from x=[0,0]
[fxs,xs] = peek(); % fxs and xs are cell arrays where xs has the points evaluated at each step and fxs has the function values

Categorías

Más información sobre Solver Outputs and Iterative Display 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