area under a curve matlab
Yes, all the numerical methods are just approximations of an actual function.
Really if you just added up all the y values this would just be an approximation as well as you will not actually know all the values of the function at all times.
ie let's say you have a function f(x) and you know f(5),f(5.1),f(5.2). Since you don't actually know f(5.11), f(5.111), f(5.1111) etc if you simply add up all the y values it will still be an approximation. As your step size (step size=0.1 for using 5,5.1,5.2...) decreases the error of your approximation decreases as well. Once your step size approaches 0, you get the integral of the function.
The point of the numerical methods is to reduce the error between your approximation and the integral of the real function.