How can i find this minima?
Show older comments
Hi everyone!
I have a question regarding finding peaks. I already used the "peakfinder"- function by Nathanael Yoder to find the 5 peaks (maximum), but I also have to find the marked values (minima). By doing it with his function I do not get them properly

. Does someone have an idea how to solve it? Many thanks in advance!
Accepted Answer
More Answers (1)
Cedric
on 7 Oct 2017
While it is not a very robust method, these points are the last points of the curve before the derivative becomes very negative. You could get them simply with:
pos = find( diff( signal ) < -4 ) ;
or use [diff(signal)<-4], false] for performing logical indexing, and you may want to subtract some offset to the positions if you want to get points a little before the signal starts going down.
4 Comments
Peter Bu
on 8 Oct 2017
Try something along this line:
d = diff( signal ) ;
pos = find( d < -4 ) ;
isRelevant = d(pos-1) < 0 ; % Or any other condition(s).
pos = pos(isRelevant) ;
Peter Bu
on 8 Oct 2017
Cedric
on 8 Oct 2017
My mistake, I updated variable names to simplify the notation and I forgot to change this one! See the updated comment.
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!