continuous plot of minimization results
Ältere Kommentare anzeigen
Hello,
I'd like to run the fminsearch solver for a couple of times and plot the progress of the minimization (the residual terms) incessantly:
options=optimset('PlotFcns',@plot_optim_out,'MaxIter',100);
for i=1:5
[x_iter,~,~,output]=fminsearch(fun,x_iter,options);
ii=ii+output.iterations;
end
function [stop] = plot_optim_out(~,optimValues,~)
global P_diff; global P_hom; global P_c1;
i=optimValues.iteration+evalin('base','ii');
stop = false;
hold on;
plot(i,P_diff/P_c1,'b*',i,P_hom/P_c1,'go');
set(gca,'yscale','log');
drawnow;
end
The plot continues to count, but the axis refreshes, so the plot "forgets" the previous data points. Does anybody have an idea why?
Regards
Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!