%% Bisection Method for loop Matlab code %Dejen Ketema Marhc,2019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function p=bisection_2019_dej(f,a,b,tol) fprintf(' n a b p f(p) \n'); fprintf('===========================================================\n'); if f(a)*f(b)>0 error('Bisection is not Computable') end for n=1:100 p=(a+b)/2; if p-a0 a=p; else b=p; end end