bugGNU Octave - Bugs: bug #42832, signal package: findpeaks:...


bug #42832: signal package: findpeaks: operator -: nonconformant arguments - when no peaks found

Submitted by:  None
Submitted on:  Wed Jul 23 10:44:53 2014  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Thu Feb 25 15:03:24 2016, comment #6:

For what is worth, I fixed the real origin of this problem by allowing automatic broadcasting with zero length dimensions. I http://hg.savannah.gnu.org/hgweb/octave/rev/12280fef2741

Carnë Draug <carandraug>
Project Member
Sun Feb 22 17:30:55 2015, comment #5:

I've added more input validation checking to findpeaks and also modified it to accept a row vector input:


Mike Miller <mtmiller>
Project Administrator
Mon Jan 19 18:12:19 2015, comment #4:

Mike, sorry for the late reply.

cset 56e2f21ec883 fixed the "error: findpeaks: operator -: nonconformant arguments (op1 is 0x1, op2 is 1x0)" when using a column vector with no max or min (ones (6, 1)) for me. The reason is:

but with bsxfun:

The other problem is, if DATA is a row vector despite the help text explicitely says: "DATA is expected to be a single column vector"

I think we should issue an error in this case:

Thank you, Andy

Andreas Weber <andy1978>
Project Member
Sun Jan 11 16:58:27 2015, comment #3:

I can still reproduce, but only when the input vector is a row vector. Andy, did you try to reproduce with a row or column vector?

Mike Miller <mtmiller>
Project Administrator
Tue Nov 25 12:39:29 2014, comment #2:

I can't reproduce this with signal 1.3.2, must have been fixed at some stage between.

Andreas Weber <andy1978>
Project Member
Thu Jul 24 12:27:39 2014, comment #1:

Thanks for your bug report. Confirmed here as well.

Mike Miller <mtmiller>
Project Administrator
Wed Jul 23 10:44:53 2014, original submission:

When using findpeaks (from the 1.3.0 version of the signal processing toolset) on a data set where there are no peaks, e.g. [1 1 1 1 1 1], then the following error is raised:

'error: findpeaks: operator -: nonconformant arguments (op1 is 0x1, op2 is 1x0)
error: evaluating argument list element number 1
error: called from:
error: findpeaks.m at line 135, column 5'

This may be by design, but perhaps returning empty idx and pks arrays would be more condusive as opposed to having to catch and handle this error to handle the case when no peaks are found. For comparison, the findpeaks function in Matlab returns an empty array on finding no peaks.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Feb 22 17:30:55 2015mtmillerStatusConfirmed=>Fixed
    Thu Jul 24 12:27:39 2014mtmillerItem GroupInaccurate Result=>Incorrect Result
      Operating SystemGNU/Linux=>Any

    Back to the top

    Powered by Savane 3.1-cleanup1