4

I have a set data and I'd like to find the upper and lower peaks of it. In Matlab, I am trying findpeaks command, but the result is strange.

Here is my simple code:

 [pks,locs] = findpeaks(Data);
 plot(locs,pks,'or')

and here is the result: enter image description here

Can someone guide me on how I can find only the very top and very bottom peaks of the data?

NESHOM
  • 899
  • 16
  • 46

1 Answers1

2

You could use the additional input MinPeakProminence to tell Matlab to look only for, yeah well prominent peaks.

[pks,locs] = findpeaks(Data,'MinPeakProminence',4);
 plot(locs,pks,'or')

You can play with the parameter and see what works best for you.

Alexander Büse
  • 564
  • 7
  • 15