trouble of taking derivative of function in newton method
1 view (last 30 days)
I'm trying to write a code for newton method. But I'm having a trouble of taking the derivative of the function(f(x(i))). Here is the code I have:
function [root]=newton_method(f, xi, tol, maxn) % f is function handle
for i= 1:maxn
fprime = diff(f(x(i)),xi);
if abs (x(i)-root)< tol
Can someone tell me how to fix it?