Calculate area under peak

조회 수: 10 (최근 30일)
Amir Cawich
Amir Cawich 2023년 2월 22일
댓글: Timo Dietz 2023년 2월 22일
I am trying to find the area under the curve as shown in the image. I found the peaks of the signal and plotted the line on the signal. I am looking to calculate the area shaded in green for the entire signal. I have no idea how to do this. Any ideas are welcomed. Thank you
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 2월 22일
For the 3rd area from left, why is the area not a triangle and a quadrilateral?
Because the 4th point is higher than 3rd point?

댓글을 달려면 로그인하십시오.

채택된 답변

Timo Dietz
Timo Dietz 2023년 2월 22일
Not sure whether I got your issue.
What about resampling (resample command) the red and blue trace to the same x step size.
Then, you only have to subtract the area under the red from the area under the blue trace, respectively, just subtract all indiviudal data points and sum up the differences. To achieve the area you certainly have to finally multiply by the x step size.
  댓글 수: 1
Timo Dietz
Timo Dietz 2023년 2월 22일
Note, that the accuracy of the area calculation is certainly limited to the chosen x step size (discrete values).

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2023년 2월 22일
Read about the functions polyarea, trapz. Provde the (x,y) data of the curve for which you want to calculate the area.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by