Selection Portions of a Plot

1 Ansicht (letzte 30 Tage)
T
T am 18 Okt. 2012
Suppose I have this function with multiple peaks that ranges from time = 2000 s to time = 7000 s.
Suppose there are five peaks and they are seperated evenly apart.
Suppose I want to pick the third peak.
How would I do this in MATLAB?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 18 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 18 Okt. 2012
t=0:0.1:30
y=sin(t)
[peaks,idx]=findpeaks(y)
%the third peak is
peaks(3)
  3 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 18 Okt. 2012
can you post your data using a link
Star Strider
Star Strider am 18 Okt. 2012
The findpeaks function is part of the Signal Processing Toolbox.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by