Unconstrained Optimization using fminunc and plotting convergence history
Afficher commentaires plus anciens
I have solved an unconstrained optimization problem using fminunc. I now want to plot the convergence history, ie , plotting the function value at each iteration of a graph. How do I extract the iteration and function value arrays so that I can do so?
clear all
close all
clc
fun=@(x)((x(1)-10*x(2)).^2)+(5*(x(3)-x(4))^2)+((x(2)-2*x(3))^4)+(10*(x(1)-x(4))^2);
x0=[1,2,3,4];
[x,fval]=fminunc(fun,x0)
options = optimoptions(@fminunc,'Display','iter','Algorithm','quasi-newton');
1 commentaire
Walter Roberson
le 31 Oct 2018
Why not use PlotFcn option?
Réponses (0)
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!