MATLAB: Finding the highest peak in each section of a graph

peak

Hi,
I managed to plot a graph of torque against time but I am having trouble trying to find the highest peak for each of the 3 curves ("trial") on this continuous graph. I managed to find all the peaks with "findpeaks(y)" but I only want the highest one for each "trial".
Any ideas how I could do it? (I just started on matlab and have no programming knowledge so it would be great if it could be as simple as possible!)
Thanks!

Best Answer

Call the findpeaks function with MinPeakProminence specified. For example, try this
findpeaks(y, 'MinPeakProminence', 100); % tune the value of MinPeakProminence