What is peak finding?
If you are equal and greater than the elements on left and right side than you are the peak. In case of the edges, you only have to look at only one side. For example, position 9 is a peak if i >= h. So the problem we solve right now is represented as “Find a peak if exists”.
How to detect peak in matlab?
Use findpeaks with default settings to find the peaks of the signal and their locations. [pks,locs] = findpeaks(PeakSig,x); Plot the peaks using findpeaks and label them. Sort the peaks from tallest to shortest.