How do i find the amplitude of a peak in my plot?

I want to find the peak with the most height(not the maximum y value, but the distance from the local minima just before the peak to the peak). Kindly help out.

1 commentaire

madhan ravi
madhan ravi le 12 Mar 2019
Modifié(e) : madhan ravi le 12 Mar 2019
Perhaps:
PEAKS=findpeaks(y);
max(abs(diff(PEAKS)))

Connectez-vous pour commenter.

 Réponse acceptée

Star Strider
Star Strider le 12 Mar 2019

1 vote

I want to find the peak with the most height(not the maximum y value, but the distance from the local minima just before the peak to the peak).
That seems to be defined by the ‘prominence’ of the peak. You can set a minimum for it as 'MinPeakProminence' (link) if you already know what it is, or you can have findpeaks output it in the p (link) output.

2 commentaires

That worked. Thank you.
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (1)

Raghunandan V
Raghunandan V le 12 Mar 2019

0 votes

Hello,
Find the slope for each case. When there is change in slope from positive to negative, its a peak. If the slope changes from negetive to positive then its a crust.
formula for slope is (Y2 - Y1) / (X2 - X1)

2 commentaires

Alex Sam Thomas
Alex Sam Thomas le 12 Mar 2019
Modifié(e) : Alex Sam Thomas le 12 Mar 2019
thank you for your answer. But I don't want to to see if it is a peak. I have the peaks and i want to find the one with the biggest amplitude.
ymax=max(y)

Connectez-vous pour commenter.

Produits

Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by