How to calculate area under peak?

1 回表示 (過去 30 日間)
Namira
Namira 2017 年 6 月 2 日
回答済み: KSSV 2017 年 6 月 2 日
I want to calculate the area under peak? Is Matlab have any default function to do it? Anyone can help? thanks.
  2 件のコメント
Star Strider
Star Strider 2017 年 6 月 2 日
If you want to define the individual peaks, use the Signal Processing Toolbox findpeaks function on the negative of your data. Then use those indices with the trapz function on your original data to get the areas under the individual peaks. This will most likely require a for loop.
See the documentation for the various functions for information on how to use them. I leave the details to you.
Benjamin Kraus
Benjamin Kraus 2017 年 6 月 2 日
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).

サインインしてコメントする。

採用された回答

KSSV
KSSV 2017 年 6 月 2 日
doc trapz

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by