a b/Supporting Functions/fcnRemoveShortEvents.m
1
function z=fcnRemoveShortEvents(z,n); 
2
3
% check for too-short suppressions
4
ct=0; i0=1; i1=1; 
5
for i=2:length(z); 
6
    if z(i)==z(i-1); 
7
        ct=ct+1; i1=i; 
8
    else 
9
        if ct<n; z(i0:i1)=0; end
10
        ct=0; i0=i; i1=i;                
11
    end                
12
end
13