Navigation

Operators and Keywords

Function List:

C++ API

fzero.m File Reference


Functions

endif if (nargin< 2||nargin > 3) print_usage()
endif if (ischar(fun)) fun
 if (funvalchk) fun
 if (length(x0) > 1) b
else if (a==0) aa
 if (sign(fa)*sign(fb)<=0) break
endif endfor endif if (b< a) u

Variables

 function [x, fval, info, output]
 return
endif funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on")
 outfcn = optimget (options, "OutputFcn")
 tolx = optimget (options, "TolX", 0)
 maxiter = optimget (options, "MaxIter", Inf)
 maxfev = optimget (options, "MaxFunEvals", Inf)
persistent mu = 0.5
endif info = 0
 niter = 0
 nfev = 0
 x = fval = a = fa = b = fb = NaN
 a = x0(1)
 fa = fun (a)
 fb = fun (b)
else aa = a
endif for b
 fu = fa

Function Documentation

endif endfor endif if (  ) 

if ( sign(fa)*sign(fb)<=  0  ) 

else if ( = =0  ) 

if ( length(x0)  ,
 
)

if ( funvalchk   ) 

endif if ( ischar(fun)   ) 

endif if ( nargin< 2||nargin 3  ) 


Variable Documentation

a = x0(1)

function aa = a

b

Initial value:

 [0.9*aa, 1.1*aa, aa-1, aa+1, 0.5*aa 1.5*aa, -aa, 2*aa, -10*aa, 10*aa]
      fb = fun (b)

fa = fun (a)

fb = fun (b)

fu = fa

Initial value:

 fzero (fun, x0, options = struct ())


  if (nargin == 1 && ischar (fun) && strcmp (fun, 'defaults'))
    x = optimset ("MaxIter", Inf, "MaxFunEvals", Inf, "TolX", 0, 
    "OutputFcn", [], "FunValCheck", "off")

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

endif info = 0

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

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

persistent mu = 0.5

nfev = 0

niter = 0

outfcn = optimget (options, "OutputFcn")

return

tolx = optimget (options, "TolX", 0)

x = fval = a = fa = b = fb = NaN