Skip to content

Commit

Permalink
Merge pull request #8 from sccn/master
Browse files Browse the repository at this point in the history
Still numerical event boundary but simplier code
  • Loading branch information
widmann authored Jul 13, 2022
2 parents 785254e + 77d3ef2 commit 782562f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.5
- ENH: handles events of type -99 if EEGLAB option set
- ENH: further checks when processing datasets with boundaries

Version 2.4
- BUG: new fix command line call for backward compatibility in pop_eegfiltnew.m

Expand Down
2 changes: 1 addition & 1 deletion eegplugin_firfilt.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

function vers = eegplugin_firfilt(fig, trystrs, catchstrs)

vers = 'firfilt2.4';
vers = 'firfilt2.5';
if nargin < 3
error('eegplugin_firfilt requires 3 arguments');
end
Expand Down
8 changes: 6 additions & 2 deletions findboundaries.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@

function boundaries = findboundaries(event)

if isfield(event, 'type') & isfield(event, 'latency') & cellfun('isclass', {event.type}, 'char')
if isfield(event, 'type') && isfield(event, 'latency')

% Boundary event indices
boundaries = strmatch('boundary', {event.type});
if all(cellfun('isclass', {event.type}, 'char'))
boundaries = strmatch('boundary', {event.type});
else
boundaries = find([ event.type ] == -99);
end

% Boundary event latencies
boundaries = [event(boundaries).latency];
Expand Down

0 comments on commit 782562f

Please sign in to comment.