Plotting x vector of fmincon
2 views (last 30 days)
Show older comments
Dear All,
I am trying to plot the x value of fmincon to show how the transition phase reaches its optimum value.
I will get x(1),x(2),(3),..... x(6)
Each x starts at initial point and reaches to its upper bound or to its lower bound. I would like to plot all the six variables on a single plot to present the transition of all the variables for every iteration.
I tried plotfn with options = optiset('Display', 'iter') it provides bars of the optimum values of variables.
It would also helpful if someone could help me how to save x variables for every iterations, so that i can plot.
Any suggestions are much appreciated.
Thank you,
Best Regards, Sai
0 Comments
Accepted Answer
Alan Weiss
on 8 Sep 2014
Use an output function to save the values of x. There is more detail here. There is an example of saving the history here (careful, this example uses a different syntax than fmincon, but the idea is the same).
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
More Answers (1)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!