Is there a built-in routine for doing numerical integration in Mathematica given two lists of data as {x1, x2, ..., xn} and {y1, y2, ..., yn}?
I want to do something like trapezoidal integration or others. Doesn’t seem NIntegrate can do that. Of course I can write it on my own. Just think there are probably too many numerical integration schemes to try out, especially when I am eager to get it going.
Probably not what you have in mind, but you could set up an interpolation function:
creates a list of data points (in the form of
{x,y}).creates an interpolation functions (try plotting
Plot[fun[x],{x,0,2*Pi}]to see what it is). You can then useNIntegrate:However, if you really want to do it the matlab way that’s also possible.