%% Monitor Iterations
% Monitor the steps fminbnd takes to minimize the \sin(x) function for 0< x< 2\pi.

fun = @sin;
x1 = 0;
x2 = 2*pi;
options = optimset('Display','iter');
x = fminbnd(fun,x1,x2,options)

% Copyright 2012 The MathWorks, Inc.