Plot the value of the parameters of an optimization algorithm
optimplotx ( x , optimValues , state )
This function creates and updates a plot of the value of the parameters depending on the number of iterations. It is a pre-defined plot function which should be used as an option of the “PlotFcns” option.
In the following example, we use the optimplotx function for use with the fminsearch function.
function y=rosenbrock(x)
y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
endfunction
opt = `optimset`_ ( "PlotFcns" , optimplotx );
[x fval] = `fminsearch`_ ( rosenbrock , [-1.2 1] , opt );