MATLAB: How can i see all the iteration values while using fminsearch command. I also want to get a figure to see if the error is minimized. Please help

error minimizationfminsearchfractional order pid controllerMATLABoptimization

I am trying to use fminsearch command of MATLAB to get optimized parameter values of the fractional Order PID Controller. I've got the parameter values. But I want to know how can I see all the iteration values of the cost function. I also want to get a graph showing the minimization of the errors. How can I have both of them ??

Best Answer

Include options in your fminsearch call:
options = optimset('Display','iter','PlotFcns',@optimplotfval);
[x,fval,exitflag,output] = fminsearch(fun,x0,options)
Alan Weiss
MATLAB mathematical toolbox documentation
Related Question