 <p>You want to use <a href="http://www.mathworks.com/help/signal/ref/findpeaks.html" rel="nofollow"><code>findpeaks</code></a></p> <pre><code>[pks,locs] = findpeaks(data) </code></pre> <p>You could find the local maxes that way, go left and right until it drops to a certain threshold or by a certain percentage (since the peaks have some girth), and then order them, and calculate the distances between as a subtraction between values.</p>