MATLAB: How tontegrate these data

integration

Hi All
I have a Diagram of Data x-y like this :
and the integration should look like :
having the Data of the first diagram as :
x=[0: 0.06] , you choose the step
and y = [-0.062847398, -0.057017095, -0.048434094, -0.03892462, -0.030365732, -0.023723144, -0.019435892, -0.017256826, -0.01674607, -0.01734093, -0.018578755, -0.020101786, -0.021674287, -0.023155192, -0.024468152, -0.025585016, -0.026502747, -0.027236393, -0.027807428, -0.02824128, -0.028562468, -0.028794073, -0.028956106, -0.029065736, -0.029136971, -0.029181112, -0.0292069, -0.029220911, -0.029227789, -0.029230507, -0.029230507, -0.029227789, -0.029220911, -0.0292069, -0.029181112, -0.029136971, -0.029065736, -0.028956106, -0.028794073, -0.028562468, -0.02824128, -0.027807429, -0.027236391, -0.026502745, -0.025585016, -0.024468152, -0.023155192, -0.021674288, -0.020101786, -0.018578757, -0.01734093, -0.01674607, -0.017256826, -0.019435894, -0.023723146, -0.030365737, -0.038924627, -0.048434086, -0.057017088, -0.062847398]
How can I integrate on these data so I will have more or less the same final amount of the integration that you see on the second graph : -2e-3 ? I know that my data are not precisely similar as the first graph , but I just would like to know how to do the integration with these data ? thank you

Best Answer

You could use "cumptrapz". For that you'll need to provide both x and y.
In this respect, what do you mean "you choose the step"? If there is "a step" it will be something like the integration integral over the number of sampled points...
Related Question