[4f740a]: / Supporting Functions / fcnRemoveShortEvents.m

Download this file

14 lines (11 with data), 287 Bytes

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