FUNCTION REFERENCE

fminbnd

Minimum of a scalar function on an interval.

Minimum of a scalar function on an interval.

Syntax

x = fminbnd(fun, x1, x2)

Syntax

x = fminbnd(fun, x1, x2, options)

Syntax

[x, fval, exitflag, output] = fminbnd(fun, x1, x2, options, p1, ...)

Golden-section search with parabolic interpolation; defaults: TolX 1e-4,

MaxIter and MaxFunEvals 500, Display 'notify'. options is an optimset or

optimoptions structure (or [] for defaults) supporting TolX, MaxIter,

MaxFunEvals, Display, OutputFcn, PlotFcns, and FunValCheck. exitflag is 1 on

convergence, 0 on limit, -1 if stopped by OutputFcn, and -2 if x1 > x2.

fun is a function handle (anonymous, with its captured variables, or @name)

or a function name as text.

Example

fminbnd('cos', 3, 4)   % 3.1416

Example

b = 1.5; fminbnd(@(x) (x - b)^2, 0, 5)   % 1.5000

Differences from MATLAB: none known.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.