%% Find Minimum Location and Function Value
% Find the location of the minimum of \sin(x) and the value of the minimum for 0< x< 2\pi.

fun = @sin;
[x,fval] = fminbnd(fun,1,2*pi)

% Copyright 2012 The MathWorks, Inc.