3

Mathematica easily allows you to use FindPeaks to find local maxima in your data is there any equivalent function for finding local minima?

Karsten7
  • 27,448
  • 5
  • 73
  • 134

1 Answers1

4
data = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3, 2, 4, 2, 2, 1};
valleys = {#,-#2} & @@@ FindPeaks[-data]
(* {{2, 1}, {9, 2}, {13, 2}, {17, 1}} *)

ListLinePlot[data, Epilog -> {Red, PointSize[Large], Point[valleys]}]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896