Navigation

Operators and Keywords

Function List:

C++ API

fsolve.m File Reference


Functions

endif if (nargin< 2||nargin > 3||!ismatrix(x0)) print_usage()
endif if (ischar(fcn)) fcn
 if (funvalchk) fcn
 if (!isempty(outfcn)) optimvalues.iter
 if (stop) info
 while (niter< maxiter &&nfev< maxfev &&!info) if(has_jac)[fvec
 if (issparse(fjac)) updating
 if (useqr)[q

Variables

 function [x, fvec, info, output, fjac]
 return
endif xsiz = size (x0)
 n = numel (x0)
 has_jac = strcmpi (optimget (options, "Jacobian", "off"), "on")
 cdif = strcmpi (optimget (options, "FinDiffType", "central"), "central")
 maxiter = optimget (options, "MaxIter", 400)
 maxfev = optimget (options, "MaxFunEvals", Inf)
 outfcn = optimget (options, "OutputFcn")
 updating = strcmpi (optimget (options, "Updating", "on"), "on")
 complexeqn = strcmpi (optimget (options, "ComplexEqn", "off"), "on")
 funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on")
endif macheps = eps (class (x0))
 tolx = optimget (options, "TolX", sqrt (macheps))
 tolf = optimget (options, "TolFun", sqrt (macheps))
 factor = 1
 niter = 1
 nfev = 1
 x = x0(:)
 info = 0
 fvec = fcn (reshape (x, xsiz))
 fsiz = size (fvec)
 fn = norm (fvec)
 m = length (fvec)
optimvalues funccount = nfev
optimvalues fval = fn
optimvalues searchdirection = zeros (n, 1)
 state = 'init'
 stop = outfcn (x, optimvalues, state)
 break
endif endif nsuciter = 0
 fjac = fcn (reshape (x, xsiz))
endif useqr = updating && m >= n && n > 10
 r = qr (fjac, 0)

Function Documentation

if ( useqr   ) 

if ( issparse(fjac)   ) 

if ( stop   ) 

if ( isemptyoutfcn  ) 

if ( funvalchk   ) 

endif if ( ischar(fcn  ) 

endif if ( nargin< 2||nargin > 3||!  ismatrixx0  ) 

while (  )  [new]


Variable Documentation

break

cdif = strcmpi (optimget (options, "FinDiffType", "central"), "central")

complexeqn = strcmpi (optimget (options, "ComplexEqn", "off"), "on")

factor = 1

else fjac = fcn (reshape (x, xsiz))

fn = norm (fvec)

fsiz = size (fvec)

optimvalues funccount = nfev

function[x, fvec, info, output, fjac]

Initial value:

 fsolve (fcn, x0, options = struct ())


  if (nargin == 1 && ischar (fcn) && strcmp (fcn, 'defaults'))
    x = optimset ("MaxIter", 400, "MaxFunEvals", Inf, 
    "Jacobian", "off", "TolX", 1.5e-8, "TolFun", 1.5e-8,
    "OutputFcn", [], "Updating", "on", "FunValCheck", "off",
    "ComplexEqn", "off", "FinDiffType", "central")

funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on")

optimvalues fval = fn

endif fvec = fcn (reshape (x, xsiz))

has_jac = strcmpi (optimget (options, "Jacobian", "off"), "on")

info = 0

m = length (fvec)

endif macheps = eps (class (x0))

maxfev = optimget (options, "MaxFunEvals", Inf)

maxiter = optimget (options, "MaxIter", 400)

n = numel (x0)

nfev = 1

niter = 1

outfcn = optimget (options, "OutputFcn")

r = qr (fjac, 0)

return

optimvalues searchdirection = zeros (n, 1)

state = 'init'

stop = outfcn (x, optimvalues, state)

tolf = optimget (options, "TolFun", sqrt (macheps))

tolx = optimget (options, "TolX", sqrt (macheps))

updating = strcmpi (optimget (options, "Updating", "on"), "on")

endif useqr = updating && m >= n && n > 10

x = x0(:)

endif xsiz = size (x0)