findpeaks() neglecting the high amplitude peaks.Does not work as exptected

조회 수: 1 (최근 30일)
I am attaching herewith the data i am working with. Findpeaks() is not detecting the highest amplitude peaks. Attached is the data I am working with. Following is the code:
file = 'forRef_2.xls';
col = xlsread(file,'J:J');
peaks=findpeaks(col);
[pks,locs] = findpeaks(col);
%both on same plot
figure
plot(col,'r')
hold on
plot(locs,pks,'pg', 'MarkerFaceColor','b')
legend('original','peaks')
  댓글 수: 4
Andrew Newell
Andrew Newell 2017년 4월 18일
And do you use exactly the code you have provided above? Or do you select one of the columns in col?

댓글을 달려면 로그인하십시오.

채택된 답변

Andrew Newell
Andrew Newell 2017년 4월 18일
When I try this code, I get 7 plots, and figure 7 looks like your figure except that all the peaks are correctly identified:
file = 'forRef_2.xls';
col = xlsread(file,'J:J');
for ii=1:size(col,2)
peaks=findpeaks(col(:,ii));
[pks,locs] = findpeaks(col(:,ii));
%both on same plot
figure
plot(col(:,ii),'r')
hold on
plot(locs,pks,'pg', 'MarkerFaceColor','b')
legend('original','peaks')
end
  댓글 수: 11
Andrew Newell
Andrew Newell 2017년 4월 19일
Glad to hear that you got it working!
preeti visweswaran
preeti visweswaran 2017년 4월 19일
I would be grateful to you if you could advise me another problem posted in https://www.mathworks.com/matlabcentral/answers/336003-peak-detection-without-using-findpeaks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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