>> integrate(@(x) x.^2,0,5,20,'left')
ans = 38.594
>> integrate(@(x) x.^2,0,5,20,'right')
ans = 44.844
>> integrate(@(x) sin(x),-1,5,20,'mid')
ans = 0.25761
>> integrate(@(x) sin(x),-1,5,10,'trap')
ans = 0.24889
>> integrate(@(x) x.^2,-6,6,10,'simp')
ans = 144.00