You can first interpolate your data to get a function handle. Then, you can use "integral" to integrate your data:
1. Create 50 sample data to work with
>> n = 50;
>> x = linspace(0, 2*pi, n);
>> y = sin(x) + 0.1*randn(1,n);
2. Plot the data to visualize it
3. Create an interpolation of the data, and save it as a function handle:
>> F = griddedInterpolant(x,y);
>> fun = @(t) F(t)
4. Plot the function to visualize:
5. Integrate the function with respect to x:
>> q = integral(fun, x(1), x(end))
Best Answer