%% False Position method code %Dejen ketema, March ,2019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function p=False_postion_2019_dej(f,fa,fb,a,b,tol) % Like bisection.m, but printing a convergence table fprintf(' n a b f(a) f(b) p f(p) \n'); fprintf('=====================================================================================\n'); if f(a)*f(b)>0 error('False position is not computable') end for n=1:10 p=a-fa*(b-a)/(fb-fa); if p-a0 a=p; fa=f(p); else b=p; fb=f(p); end end