My code works BUT I need to add 1 more thing:
function [ r, n ] = myNewton( fHan,dfHan,x0,fTol, itermax ) i = 1;
while abs(fHan(x0)) >= fTol r(i) = x0; n(i) = abs(fHan(x0)); i = i+1; x0 = x0-((fHan(x0))/(dfHan(x0))); end
for j = 1:itermax;
dx = fHan(r) / dfHan(r); r = r - dx
if r < fTol return end end
if abs(fHan(x0)) < fTol r(i) = x0; n(i) = abs(fHan(x0)); end
how do I go about doing this? thanks!!
No products are associated with this question.