This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: if fx1*fn < 0 x2 = xn; else x1 = xn; end fx1 = feval(fh,x1); fx2 = feval(fh,x2); xo = xn; xn = (x1+x2)/2; rhist = [rhist xm]; niter = length(rhist); if termination(xo,xn) == 1 break; end end e switch tol_type case 'a' error = abs(xn-xo); case 'r' error = abs(xn-xo)/abs(xn); case 'f' error = abs(feval(fh,xo)); end...
View Full Document
This note was uploaded on 02/18/2010 for the course ENGINEERIN 7 taught by Professor Patzek during the Spring '08 term at University of California, Berkeley.
- Spring '08