How to calculate the area under curve?

7 views (last 30 days)
AS
AS on 27 May 2021
Commented: AS on 31 May 2021
I have attached a curve in which x axis is time and y axis is amplitude. How to calculate the area under this curve.Please suggest me.

Accepted Answer

Torsten
Torsten on 27 May 2021
area_under_curve= trapz(x,y)
  3 Comments
Torsten
Torsten on 28 May 2021
Edited: Torsten on 28 May 2021
If the spacings between the x-values is 1, you can use trapz(y), else you must use trapz(x,y).
The fact that the two results are different indicates that the spacing is different from 1 in your case.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!