x= sym('x');p = 0.6;F = x^5+4*x^2-1;F_prime = diff(F);N=0;q = p - subs(F,x,p)/subs(F_prime,x,p);while(N < 100 && not(abs(p-q) <= .00001 )) N=N+1; p = q; q = p - ((subs(F,x,p))./(subs(F_prime,x,p))); end if(N == 100) print("Too many iterations");else display(q)end
MATLAB: Is the newton method giving me a huge answer? What am i doing wrong?pls help
MATLABnewton method
Best Answer