How to show value after every fsolve iteration?

20 views (last 30 days)
DavidS
DavidS on 13 Feb 2015
Commented: Alan Weiss on 17 Feb 2015
I am using fsolve to solve 9 equations with 9 unknowns. I am using the option optimset('Display','iter-detailed') to get some information after every iteration. My question is how do I get the value of my unknowns after every iteration? I would like to see how my unknowns are converging toward a solution. Is there any way to extract this?
Thank you.

Answers (1)

Alan Weiss
Alan Weiss on 17 Feb 2015
You can set the PlotFcns option to @optimplotx to see the unknowns at each iteration. You can also write an output function to store the values of the variables as the iterations proceed.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 Comments
Alan Weiss
Alan Weiss on 17 Feb 2015
Here is an example that uses an output function for fminsearch.
Here is an example using an output function for fmincon.
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by