function x = simp(f, a, b, n) x = (2*rect(@f,a,b,n)+trap(@f,a,b,n))/3