How to calculate area under curve.
1 view (last 30 days)
Show older comments
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/284042/image.png)
So, I am trying to get an area under curve (shaded area) shown above,
Assuing the boundry is "a" and "b", how could I calculate this area under curve?
2 Comments
James Tursa
on 13 Apr 2020
If you have functions defining a and b, simply integrate a - b. How are a and b defined? Functions, or data points, or ...?
Answers (2)
Ameer Hamza
on 13 Apr 2020
Edited: Ameer Hamza
on 13 Apr 2020
If the curve is available as datapoints, then you can use trapz(): https://www.mathworks.com/help/matlab/ref/trapz.html
For a specific example, please share the datapoints as a mat file.
4 Comments
See Also
Categories
Find more on Interpolation 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!