How to locate last peak in data?

4 views (last 30 days)
Maria Y
Maria Y on 21 Mar 2019
Answered: Star Strider on 21 Mar 2019
Hello,
I have a set of data with a group of artifacts at the start and end of the data (see below). What I would like to do is find the last peak in the end artifacts, and remove everything after that point.
I wasn't able to find any documentation in findpeaks about finding the first/last peak and I can't use specific indices because they change with every data set.
If anyone could offer any advice it would be much appreciated.
Thanks in advanced!

Answers (1)

Star Strider
Star Strider on 21 Mar 2019
Use the findpeaks (link) function, most likely with the 'MinPeakHeight' name-value pair. Then use the second ‘locs’ output (an an index) to determine the peak you want to remove. You can also use the mink (link) and maxk functions to help you identify these, if there are more than one.

Community Treasure Hunt

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

Start Hunting!