|MATLAB Function Reference|
Minimize a function of one variable on a fixed interval
fminbnd finds the minimum of a function of one variable within a fixed interval.
x = fminbnd(fun,x1,x2)
returns a value
x that is a local minimizer of the function that is described in
fun in the interval
x1 <= x <= x2.
x = fminbnd(fun,x1,x2,options)
minimizes with the optimization parameters specified in the structure
options. You can define these parameters using the
fminbnd uses these
options structure fields:
||Level of display.
||Maximum number of function evaluations allowed.
||Maximum number of iterations allowed.
||Termination tolerance on
x = fminbnd(fun,x1,x2,options,P1,P2,...)
provides for additional arguments,
P2, etc., which are passed to the objective function,
options= as a placeholder if no options are set.
[x,fval] = fminbnd(...)
returns the value of the objective function computed in
[x,fval,exitflag] = fminbnd(...)
returns a value
exitflag that describes the exit condition of
||Indicates that the function converged to a solution
||Indicates that the maximum number of function evaluations was exceeded.
||Indicates that the function did not converge to a solution.
[x,fval,exitflag,output] = fminbnd(...)
returns a structure
output that contains information about the optimization:
||The algorithm used
||The number of function evaluations
||The number of iterations taken
fun is the function to be minimized.
fun accepts a scalar
x and returns a scalar
f, the objective function evaluated at
x. The function
fun can be specified as a function handle.
myfun is a MATLAB function such as
fun can also be an inline object.
Other arguments are described in the syntax descriptions above.
x = fminbnd(@cos,3,4) computes to a few decimal places and gives a message on termination.
computes to about 12 decimal places, suppresses output, returns the function value at
x, and returns an
exitflag of 1.
fun can also be an inline function. To find the minimum of the function on the interval
(0,2), create an inline object
The result is
The value of the function at the minimum is
The algorithm is based on Golden Section search and parabolic interpolation. A Fortran program implementing the same algorithm is given in .
The function to be minimized must be continuous.
fminbnd may only give local solutions.
fminbnd often exhibits slow convergence when the solution is on a boundary of the interval.
fminbnd only handles real variables.
Forsythe, G. E., M. A. Malcolm, and C. B. Moler, Computer Methods for Mathematical Computations, Prentice-Hall, 1976.