Hello
The issue is resolved by discussion with some friends
% say we are integrating a data resembling a parabola
x = -2:0.01:1;
y = x.^2;
% say you wanted to integrate from x = -2 to x = 0..
% (lower limit x = -2 is variable..may use a loop over x as per user's req.)
index = find(x == 0);
I = cumtrapz(x(1:index),y(1:index));
% any ' i'th ' element in 'I' denotes integration from x = -2 to x = x(i)
-I(end) % this should give integration of x.^2 from -2 to 0