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

cevent_remove_long_segments

PURPOSE ^

cevent_remove_long_segments deletes event intervals that are too long

SYNOPSIS ^

function [res] = cevent_remove_long_segments(cevent, maxDuration)

DESCRIPTION ^

 cevent_remove_long_segments deletes event intervals that are too long

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

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