How do I Input both x-coordinates and y-coordinates into the findpeaks function?

4 ビュー (過去 30 日間)
Ibrahim Suleiman
Ibrahim Suleiman 2021 年 4 月 23 日
回答済み: Chunru 2021 年 4 月 23 日
Hi, I want to use my x-coordinates and y-coordinates as inputs when using the findpeaks function but for some reason, it does not let me.
%Find the peaks displaying magnitude,width,locations
%only selecting the largest peaks
[pks,w,locs] = findpeaks(x,s,'MinPeakHeight',100)
x = is a time vector that starts at zero and slowly increases.
s= is the y axis values. Both x and s are the same size.
I need to do this so that I can find the location of the peaks in my signal using the X-values that came with the signal.
Can someone help me with this?

回答 (1 件)

Chunru
Chunru 2021 年 4 月 23 日
[pks, locs, w] = findpeaks(s, x, ...)
doc findpeaks for details.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by