bisect2 - f ya = feval(func,a,y yb = feval(func,b,y y while...

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

View Full Document Right Arrow Icon
% Derek Rampal % bisect2 % % pass: % % a,b for interval, % delta is tolerance, % y is second variable for func % returns guess for root, error in calculation, and the function value % function [c,error,yc] = bisect2(func,a,b,delta,y)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f ya = feval(func,a,y); yb = feval(func,b,y); y while( b-a >= delta) c=(a+b)/2; yc=feval(func,c,y); if yc == 0 a=c; b=c; elseif (sign(yb) == sign(yc)) b=c; yb=yc; else a=c; ya=yc; end; end; error = b-a;...
View Full Document

This note was uploaded on 09/19/2009 for the course MATH numerical taught by Professor Ford during the Spring '09 term at FAU.

Ask a homework question - tutors are online