Calculate area under peak
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amir Cawich
el 22 de Feb. de 2023
Comentada: Timo Dietz
el 22 de Feb. de 2023
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![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1302945/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1302945/image.png)
1 comentario
Dyuman Joshi
el 22 de Feb. de 2023
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?
Respuesta aceptada
Timo Dietz
el 22 de Feb. de 2023
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 comentario
Timo Dietz
el 22 de Feb. de 2023
Note, that the accuracy of the area calculation is certainly limited to the chosen x step size (discrete values).
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!