Selection Portions of a Plot

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?

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 18 日
編集済み: Azzi Abdelmalek 2012 年 10 月 18 日

0 投票

t=0:0.1:30
y=sin(t)
[peaks,idx]=findpeaks(y)
%the third peak is
peaks(3)

3 件のコメント

T
T 2012 年 10 月 18 日
編集済み: T 2012 年 10 月 18 日
I guess I am being misleading when I say function. I actually have a whole set of data points that contribute to these so-called peaks. So I don't think that findpeaks would apply? It's interesting to know that there is such an operator.
Furthermore, where do I find findpeaks.m? Is this supposed to be built into MATLAB?
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 18 日
can you post your data using a link
Star Strider
Star Strider 2012 年 10 月 18 日
The findpeaks function is part of the Signal Processing Toolbox.

サインインしてコメントする。

その他の回答 (0 件)

タグ

質問済み:

T
T
2012 年 10 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by