{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

newtraph - ea=abs(xi-xold/xi fprintf...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function newtraph(xi,iter) %problem 6.4, using Newton-Raphson method iter=iter+1; count=0; xold=0; disp(' i xi f(x) f_(x) ea'); while(1) f=8*sin(xi)*exp(-xi)-1; f_prime=(8*cos(xi)/exp(xi)) - (8*sin(xi)/exp(xi));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ea=abs((xi-xold)/xi); fprintf(' %1d %7.6f %6.5f %6.5f %6.5f\n',count, xi,f,f_prime,ea) xold=xi; xi=xi-(f/f_prime); count=count+1; if count==iter; break; end end end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online