findpeaks() can detect multiple peaks if there is/are change in direction(s) even if the values are above the specified threshold (see arrows in the attached pdf file).
J=a vector;findpeaks(J,'MinPeakHeight',Threshold);hold on;yline(Threshold,'--','LineWidth',3);hold off
Best Answer