# How to calculate area under peak?

11 views (last 30 days)
Namira on 2 Jun 2017
Answered: KSSV on 2 Jun 2017
I want to calculate the area under peak? Is Matlab have any default function to do it? Anyone can help? thanks.
##### 2 CommentsShowHide 1 older comment
Benjamin Kraus on 2 Jun 2017
You are going to need to provide more details so that someone can help you.
For instance:
• How do you define "peak"? Do you want the largest value? Or the entire curve?
• You are asking about the area, so you need to specify the x-range you want to measure. How wide is the "peak"?
• You haven't indicated how you are specifying the x- and y-values. Are the x-values evenly spaced? Are they spaced at unit intervals? If not, what is the spacing?
If you want to know the area under the entire curve, just sum the values and divide by the x-limits (assuming x-values are uniformly spaced).

Sign in to comment.

### Accepted Answer

KSSV on 2 Jun 2017
doc trapz
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Community Treasure Hunt

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

Start Hunting!