Exclude last sample as peak despite being the maximum

조회 수: 1 (최근 30일)
Hg
Hg 2015년 10월 20일
댓글: Star Strider 2015년 10월 20일
The first sample is excluded despite being the maximum in findpeaks(). How to exclude the last peak?
  댓글 수: 1
Adam
Adam 2015년 10월 20일
Assuming you mean the peak that comes with the final sample can't you just delete the last peak from the list of peaks that get found? It may need a test to check the peak location is equal to the last index as it may be a trough instead in some cases, but that depends on your data.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2015년 10월 20일
The findpeaks function has a number of name-value pair arguments you can use. For example, if you only want one peak (the first one that meets other criteria you may set), set 'NPeaks',1 in the argument list. Others you can set that might do what you want are 'MinPeakDistance' and 'Threshold'.
  댓글 수: 2
Hg
Hg 2015년 10월 20일
I've checked the documentation and tried some of the arguments but I still don't have any idea how to find the peak annotated above.
Star Strider
Star Strider 2015년 10월 20일
I would probably use these two arguments: 'MinPeakDistance',100,'NPeaks',1. You will have to experiment to get the result you want. Without your data, it is not possible to provide exact code.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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