% newton driver - test of three options
% for specifying functions
f1=@(x) x.^2 - 2;
f1prime = @(x) 2*x;
x0 = 2;
tol = 10^(-4);
% option 1
%xc=newton_tdelillo(f1,f1prime,x0,tol);
% option 2
%xc=newton_tdelillo(@(x) x.^2 - 2,@(x) 2*x,x0,tol);
% option 3 (not permitted)
%xc=newton_tdelillo(@f2,@f2prime,x0,tol);
% option 4
xc=newton_tdelillo(@f2,@f2prime,x0,tol);
xc.'

%  not permitted. This did not work with option 3:
%function y = f2(x)
%y = x.^2 -2;
%end

%function yprime = f2prime(x)
%yprime = 2*x;
%end

