FUNCTION REFERENCE

fminsearch

Minimum of a function of several variables (Nelder-Mead simplex).

Minimum of a function of several variables (Nelder-Mead simplex).

Syntax

x = fminsearch(fun, x0)

Syntax

x = fminsearch(fun, x0, options)

Syntax

[x, fval, exitflag, output] = fminsearch(fun, x0, options, p1, ...)

x has the shape of x0. Defaults: TolX and TolFun 1e-4, MaxIter and MaxFunEvals

200*numel(x0), Display 'notify'. options is an optimset or optimoptions structure

(or [] for defaults) supporting TolX, TolFun, MaxIter, MaxFunEvals, Display,

OutputFcn, PlotFcns, and FunValCheck. exitflag is 1 when converged, 0 when the

limit was reached, and -1 if stopped by OutputFcn.

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

or a function name as text.

Example

[x, fv] = fminsearch('cos', 3)   % x = 3.141577, fv = -1.000000

Example

c = [1 -2]; fminsearch(@(x) sum((x - c).^2), [0 0])   % about [1 -2]

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.