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 CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by