MATLAB: Findpeaks() neglecting the high amplitude peaks.Does not work as exptected

findpeaks() messing with finding highest peaks

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')

Best Answer

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