local minima

15 views (last 30 days)
Malinda
Malinda on 1 Apr 2011
Is there an easy way to find local minima for a curve, starting with discrete data? In other words, if I have a set of x and y values, is there a way that I can find all of the local minima for a plot of y vs. x without having to manually fit a function and find where the derivatives are zero?

Answers (2)

Walter Roberson
Walter Roberson on 1 Apr 2011
You should probably think more about what you mean by a "local minima".
If a curve is curling clockwise, the (x2,y2) could be said to be a local minima on the curve if it is on the "right hand side" of the vector connecting (x1,y1) and (x3,y3). I suspect, though, that this will find more points than you wish found.
If the points were subject to noise then you may wish to apply some smoothing before you do the testing. Unfortunately I don't think I know at the moment what the two-dimensional equivalent of traditional smoothing algorithms such as "moving average" are.
The situation is easier if the curve has monotonic x or y (or both)

Paulo Silva
Paulo Silva on 1 Apr 2011
[C,I] = min(y) %C is the value and I is the index
x(I) %gives the x value of the local minima

Tags

Products

Community Treasure Hunt

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

Start Hunting!