How do I select a specific peak in a repeating pattern?
Show older comments
y is my data and I am trying to find the first peak of each repeating part, but in the third part, the last peak is greater than the first peak so the last peak is the peak that gets selected. This problem only occurs when the last peak is greater than the first peak. Nothing I have tried has been working.
pks = findpeaks(y,'MinPeakHeight', 200,'MinPeakDistance',4000)
Accepted Answer
More Answers (1)
Image Analyst
on 5 Sep 2017
Edited: Image Analyst
on 5 Sep 2017
0 votes
OK, not too hard (a variety of ways to do it probably), but you forgot to attach your data, so I'll wait for that, as will probably most people. I'd probably threshold and find each group, then scan within the group to find out when the data stops increasing and starts decreasing. You can use diff() for that.
1 Comment
Spencer Smith
on 5 Sep 2017
Edited: Spencer Smith
on 5 Sep 2017
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!