Area between curve (numerical data with positive and negative values) and y = 0
Show older comments
Hi all,
I am trying to calculate the area between a curve (defined by numerical data rather than a function) and the x-axis. I don't think it is a straightforward trapz application as the curve has noise that at times oscillates above and below y = 0 (i.e. the numerical data is positive and negative) and I don't want the 'negative' areas to be subtracted from the positive ones. Hopefully that makes sense...
An example of the data is attached.
Thank you so much in advance! 

Edit: To clarify, I don't want to areas under y = 0 to contribute to the result at all so I can't abs(y). Thanks again!
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!