%% Obtain All Information
% Return all information about the fminbnd solution process by requesting all outputs. Also, monitor the solution process using a plot function.

fun = @sin;
x1 = 0;
x2 = 2*pi;
options = optimset('PlotFcns',@optimplotfval);
[x,fval,exitflag,output] = fminbnd(fun,x1,x2,options)

% Copyright 2012 The MathWorks, Inc.