ex16.m -- main script to find root;
autoRoot.m—this function uses brackPlot.m and newton.m to automatically find brackets and roots of the equation f(x);
fun.m –evaluates f(x);
dbydx.m—evaluates f’(x);
brackPlot.m—finds brackets for the given equation f(x) with xmin and xmax;
newton.m—finds roots with brackets evaluated by brackPlot.m ;
function r = newton(fun,dbydx,x0,xtol,ftol,verbose)
% newton Newton's method to find a root of the scalar equation f(x) = 0
%
% Synopsis: r = newton(fun,dbydx,x0)
% r = newton(fun,x0,xtol)
% r = newton(fun,x0,xtol,ftol)
% r = newton(fun,x0,xtol,ftol,verbose)
%
% Input: fun = (string) name of mfile that returns f(x).
% dbydx = name of mfile that returns f'(x)
% x0 = initial guess
solution incomplete bcos only 1000 characters