FUNCTION REFERENCE

fminunc

Minimum of a smooth function of several variables, without constraints.

Minimum of a smooth function of several variables, without constraints.

Syntax

x = fminunc(fun, x0)

Syntax

x = fminunc(fun, x0, options)

Syntax

[x, fval, exitflag, output, grad, hessian] = fminunc(...)

Quasi-Newton BFGS: each step solves B*p = -g with the current Hessian

estimate B and searches along p for a point that meets the strong Wolfe

conditions. The gradient is estimated by finite differences, or is the

second output of fun when SpecifyObjectiveGradient is true. hessian is the

final BFGS estimate B; grad is a column.

It stops when max(abs(grad)) <= OptimalityTolerance * max(1, max(abs(grad0))),

when a step is shorter than StepTolerance * (1 + norm(x)), when the change

in f is below FunctionTolerance * max(1, abs(previous_f)), or after

MaxIterations (400) or MaxFunctionEvaluations (100*numel(x0)). exitflag: 1

small gradient, 2 short step, 3 small relative function change, 0 limit reached,

-3 unbounded descent (f < -1e20 or step norm > 1e20) or failed line search.

Failed Wolfe searches fall back to Armijo backtracking along steepest descent

with a scaled identity Hessian. Tolerances must be finite and positive.

Example

[x, fval] = fminunc(@(x) (x(1)-1)^2 + 3*(x(2)+2)^2, [0 0])   % about [1 -2], 0

Differences from MATLAB: only the 'quasi-newton' algorithm; the printed

messages are MatRust's own.

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