fminunc( FCN, X0); fminunc( FCN, C0, Options); [X, FVEC, INFO, OUTPUT, GRAD, HESS] = fminunc (FCN, ...); %Solve an unconstrained optimization problem defined by the function FCN. %X0 determines a starting guess. %OPTIONS is a structure specifying additional options. Currently, `fminunc' recognizes these %options: "FunValCheck", "OutputFcn", "TolX", "TolFun", "MaxIter", "MaxFunEvals", "GradObj", %"FinDiffType", "TypicalX", "AutoScaling". (optimset) %On return, FVAL contains the value of the function FCN evaluated at X %INFO may be one of the following values:
%1 Converged to a solution point.
%2 Last relative step size was less that TolX.
%3 Last relative decrease in function value was less than TolF.
%0 Iteration limit exceeded.
%-3 The trust region radius became excessively small. %Notes: If you only have a single nonlinear equation of one
% variable then using `fminbnd' is usually a much better idea. The
% algorithm used is a gradient search which depends on the objective
% function being differentiable. If the function has
% discontinuities it may be better to use a derivative-free
% algorithm such as `fminsearch'.