Finding coordinates of peaks
2 views (last 30 days)
I have a data file that looks like this: http://imageshack.us/photo/my-images/26/peakds.jpg/ and I would like to return the position of the two highest peaks. Does anyone have any neat ways of doing this?
Kevin Sharp on 7 Jun 2012
You need to first perform non-maximal suppression and then sort the remaining data.
Try this ...
x = 1:100;
data(ordfilt2(data,3,[1 1 1])>data) = 0;
[v,i] = sort(data,'descend');