MATLAB: How to identify and get the average of local maximum negative peaks for a set of data

finding local maximums negative peaks

Hello,
What is the best function that can be used to find and get the mean values of the circled (red color) local maximum negative peaks for a set of data?
Thank you

Best Answer

If you have R2017b, see if the islocalmin (link) function will do what you want.
If you have the Signal Processing Toolbox, another option is to use the findpeaks (link) function on your negated signal (turning minima into maxima). The locations will be correct and not require any transformation, the peak values returned will be the negative of the actual values.
Use the mean (link) function to get the average (arithmetic mean).
Related Question