Use your input argument, your for-loop looks like this:
for x=1000:2000:-999
No loop is executed at all.
I don't think your subinterval is defined correctly. Running calculateintegral(0,100,2) seems to give you some results.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!