how to get x value of findpeaks

조회 수: 26 (최근 30일)
Alpay-Kaan Erbay
Alpay-Kaan Erbay 2022년 5월 18일
편집: Davide Masiello 2022년 5월 18일
I use the following findpeaks method:
peaks = findpeaks(smoothed{i}, 'MinPeakHeight',0.5,...
'MinPeakDistance',200);
the peaks matrix for this contains the y values, but I would like to have the x values. How do I get these?

답변 (1개)

Davide Masiello
Davide Masiello 2022년 5월 18일
편집: Davide Masiello 2022년 5월 18일
If X is your array of x-values, do
[peaks,locs] = findpeaks(smoothed{i},'MinPeakHeight',0.5,'MinPeakDistance',200);
x_peaks = X(locs);
You can find more info at

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by