How to calculate area under curve.

2 次查看(过去 30 天)
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 个评论
James Tursa
James Tursa 2020-4-13
If you have functions defining a and b, simply integrate a - b. How are a and b defined? Functions, or data points, or ...?
Sun Kyoo Choi
Sun Kyoo Choi 2020-4-13
编辑:Sun Kyoo Choi 2020-4-13
Everything is in data points.
So, basically, I imported from the excel datasheet and extracted to MATLAB.
Also, I know a and b values.
How would the code look like?

请先登录,再进行评论。

回答(2 个)

Ameer Hamza
Ameer Hamza 2020-4-13
编辑:Ameer Hamza 2020-4-13
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 个评论

请先登录,再进行评论。


KSSV
KSSV 2020-4-13
编辑:KSSV 2020-4-13
Read about polyarea

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by