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

 
 

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

Submitter:  Andreas Weber <andy1978>
Submitted:  Tue 25 Nov 2014 09:08:43 AM UTC
   
 
Category:  Octave 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
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

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

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

Patch attached

(file #32539)

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

signal-1.3.0:


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


from


  ## 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>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group 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.13-3230.
    Corresponding source code