Home > data-analysis > manip > cevent > cevent_remove_small_segments.m

cevent_remove_small_segments

PURPOSE ^

cevent_remove_small_segments deletes event intervals that are too small

SYNOPSIS ^

function [res] = cevent_remove_small_segments(cevent, minDuration)

DESCRIPTION ^

 cevent_remove_small_segments deletes event intervals that are too small

 takes a list of cevent instances in a cevent variable and return a new 
 list by removing those instances with small durations.
 
 cevent_remove_small_segments(cevent, minDuration)
 Input:
   cevent: a cevent varible
   minDuration: the duration threshold (should be in sec in a general
   case)
 Outout:
   A new cevent variable without short instances.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [res] = cevent_remove_small_segments(cevent, minDuration)
0002 % cevent_remove_small_segments deletes event intervals that are too small
0003 %
0004 % takes a list of cevent instances in a cevent variable and return a new
0005 % list by removing those instances with small durations.
0006 %
0007 % cevent_remove_small_segments(cevent, minDuration)
0008 % Input:
0009 %   cevent: a cevent varible
0010 %   minDuration: the duration threshold (should be in sec in a general
0011 %   case)
0012 % Outout:
0013 %   A new cevent variable without short instances.
0014 
0015 
0016 
0017 logical = (cevent(:, 2) - cevent(:, 1)) >= minDuration;
0018 res = cevent(logical, :);
0019

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005