{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

bisect - yb = feval(func,b y while b-a>= delta c=(a b/2...

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

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

Unformatted text preview: yb = feval(func,b); y while( b-a >= delta) c=(a+b)/2; yc=feval(func,c); 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

{[ snackBarMessage ]}

Ask a homework question - tutors are online