Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

'MinPeakDistance' Error in findpeaks Function

88 views
Skip to first unread message

William Popov

unread,
Aug 5, 2015, 4:19:08 PM8/5/15
to
Hello,
I'm currently working with the findpeaks function to process some data from a pressure sensor. I am encountering an error to which I can't seem to find a solution. My input is as follows:

[pks,locs,w,p]=findpeaks(z,50,'MinPeakProminence',min_peak_prominence,'MinPeakDistance',2.71);
Where z and 'min_peak_prominence are the dataset and a previously assigned value greater than 2.7, respectively.

The 'MinPeakDistance' name-value argument is giving me the following error:

Error using findpeaks
Expected MinPeakDistance to be a scalar with value < 2.7.

Error in findpeaks>parse_inputs (line 318)
validateattributes(Pd,{'numeric'},{'real','scalar','nonempty','nonnegative','<',x(M)-x(1)},'findpeaks','MinPeakDistance');

Error in findpeaks (line 131)
[y,yIsRow,x,xIsRow,minH,minP,minW,maxW,minD,minT,maxN,sortDir,annotate,refW] ...

Error in lunge_splitter (line 59)
[pks,locs,w,p]=findpeaks(z,50,'MinPeakProminence',min_peak_prominence,'MinPeakDistance',2.71);

I don't understand why it expects the MinPeakDistance value to be <2.7, and this is causing some headaches in regards to processing the data. Could anyone shed some light on this?

Thanks.

P.S. I'm relatively inexperienced with MATLAB, so I apologize in advance if I'm missing something obvious.
0 new messages