bugGNU Octave - Bugs: bug #43691, findpeaks: "extra"...


bug #43691: findpeaks: "extra" undefined if no peak matches criteria

Submitted by:  Andreas Weber <andy1978>
Submitted on:  Tue 25 Nov 2014 09:08:43 AM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

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


Sun 11 Jan 2015 04:59:02 PM UTC, comment #3: 
Mike Miller <mtmiller>
Project Administrator
Fri 02 Jan 2015 11:15:28 PM UTC, comment #2: 

@Mike: Can I go ahead and push the patch?

Andreas Weber <andy1978>
Project Member
Tue 25 Nov 2014 09:24:27 AM UTC, comment #1: 

Patch attached

(file #32539)

Andreas Weber <andy1978>
Project Member
Tue 25 Nov 2014 09:08:43 AM UTC, original submission:  


octave:1> data = [0; 2; 5; 6; 5; 2; 0];
octave:2> [PKS, LOC, EXTRA] = findpeaks (data, "MinPeakWidth", 3)
error: 'extra' undefined near line 253 column 19
error: called from:
error:   /home/andy/octave/signal-1.3.0/findpeaks.m at line 253, column 17

this is because in findpeaks.m:225, "extra" is never populated if not even one peak matches the MinPeakWidth, MinPeakHeight... criterias. I think extra should returns just an empty struct in this case.

Btw, if the peaks are detected I get

warning: operator -: automatic broadcasting operation applied
warning: called from
    findpeaks at line 153 column 5


  ## Treat peaks separated less than minD as one
  D = abs (idx_s - idx_s');

I would suggest using bsxfun (@minus, idx_s, idx_s') if this is intended.

Andreas Weber <andy1978>
Project Member


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

Attach Files:

Attached Files
file #32539:  signal_bug43691.patch added by andy1978 (1017B - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by andy1978
  • -email is unavailable- added by andy1978 (Submitted the item)

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

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-11 mtmiller StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2015-01-02 andy1978 Carbon-Copy- => Added mtmiller
    2014-11-25 andy1978 Attached File- => Added signal_bug43691.patch, #32539
        StatusNone => Patch Submitted

    Back to the top

    Powered by Savane 3.5