How to find the mean peaks in positive axis

20 ビュー (過去 30 日間)
Star Rats
Star Rats 2019 年 10 月 6 日
コメント済み: dpb 2019 年 10 月 7 日
I wish to find the mean of all peaks from the positive axis in Figure 1.
I tried
pks = findpeaks(y);
but it includes some negatif value.
How to filter out the nagative peaks and remain the positive peaks?

採用された回答

dpb
dpb 2019 年 10 月 6 日
編集済み: dpb 2019 年 10 月 7 日
thresh=0; % or whatever level you wish
pks = findpeaks(y,'MinPeakHeight',thresh);
Read the doc carefully; findpeaks has all kinds of options you'll probably find useful.
  2 件のコメント
Star Rats
Star Rats 2019 年 10 月 7 日
編集済み: Star Rats 2019 年 10 月 7 日
Thanks @dpb
dpb
dpb 2019 年 10 月 7 日
NB I defined the variable threshold after first just typing in the '0' value...fixed up the Answer to reflect using the variable...dpb

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

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 10 月 6 日
Hi,
Here is a simple and fast answer to peak only positive peaks of your data:
Y = DATA; % This is your data
X = findpeaks(Y);
X_pos = X(X>0); % Selects only positive peaks
Good luck

カテゴリ

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