%%%%%%%%%%%%%%CAUTION: does not compute all roots. will not compute %%%%%%%%%%%%%%x.^(2,4,6,8,etc.)...use with caution a=-1;%first end pt. b=.9;%second end pt. x=0;%dummy variable for root %if root is on end pt. f = a.^3;%f(a) if f==0 a end %if root is on other end pt. f = b.^3;%f(b) if f==0 b end for i=0:1:100%bisection c=(a+b)/2;%besection pt. and approximate root y = c.^3;%f(c) if y==0 c end f = b.^3;%f(b) if y*f<0 a=c; else b=c; end end i%number of iterations d=b-c%error c%root f = c.^3%f(root)