previous newton function: function root=newton(f,fprime,x0,tol) if(abs(f(x0))<=t
ID: 3850933 • Letter: P
Question
previous newton function:
function root=newton(f,fprime,x0,tol)
if(abs(f(x0))<=tol)
root = x0;
return;
else
while(abs(f(x0))>tol)
xnew=x0-(f(x0)/fprime(x0));
x0=xnew;
end
root = x0;
end
end
Explanation / Answer
Answer for Question:
See the below modified version of newton method which returns the Jacobian series
function root=newton(f,fprime,x0,tol)
if(abs(f(x0))<=tol)
root = x0;
return;
else
while(abs(f(x0))>tol)
xnew=x0-(fprime(x0)/f(x0));
x0=xnew;
end
root = x0;
end
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.