Skip to content

Bug: findGlobalPeak typo (sOBj instead of sObj) in minima branch #13

@iahncajigas

Description

@iahncajigas

Bug Description

In SignalObj.m, the findGlobalPeak method has a typo on line 1607: sOBj.data instead of sObj.data. This causes a runtime error when calling findGlobalPeak(sObj, 'minima') because sOBj is undefined.

Location

SignalObj.m, line 1607:

function [ind, val] = findGlobalPeak(sObj,type)
   if(nargin<2)
       type='maxima';
   end            
   if(strcmp(type,'maxima'))
       [val,index] = max(sObj.data);
       ind = sObj.time(index);
   elseif(strcmp(type,'minima'))
       [val,index] = min(sOBj.data);   % BUG: sOBj should be sObj
       ind = sObj.time(index);
   end
end

Fix

Change sOBj to sObj on line 1607:

[val,index] = min(sObj.data);

Found During

Python port (cajigaslab/nSTAT-python) — fixed in the Python implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions