function x=intfel(a,b,n) fa=f(a); for i=1:n x=(a+b)/2; fx=f(x); if fa*fx>0 a=x; else b=x; endif endfor x=(a+b)/2 end