function x=inthalv(a,b,n) fa=a^5-100; %lower for i=1:n x=(a+b)/2; fx=x^5-100; %midpoint if fa*fx>0 a=x; else b=x; endif endfor