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

cevent_time_shift

PURPOSE ^

cevent_time_shift shifts the whole cevent by an offset

SYNOPSIS ^

function newCevent = cevent_time_shift(cevent, offset)

DESCRIPTION ^

  cevent_time_shift shifts the whole cevent by an offset
 
   cevent_time_shift(cevent, offset)
   Input: cevent (can be cevent or event and an offset in seconds; the offset can be both
   positive (moving forward) or negative (moving backward). 

   Output: a newCevent or event

  this function is useful for the purpose of comparing two temporal event
  sequences to see what is the best overall alignment between two.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function newCevent = cevent_time_shift(cevent, offset)
0002 %  cevent_time_shift shifts the whole cevent by an offset
0003 %
0004 %   cevent_time_shift(cevent, offset)
0005 %   Input: cevent (can be cevent or event and an offset in seconds; the offset can be both
0006 %   positive (moving forward) or negative (moving backward).
0007 %
0008 %   Output: a newCevent or event
0009 %
0010 %  this function is useful for the purpose of comparing two temporal event
0011 %  sequences to see what is the best overall alignment between two.
0012 %
0013 
0014 newCevent(:,1:2) = cevent(:, 1:2) + offset;
0015 if (size(cevent,2) == 3)
0016     newCevent(:,3) = cevent(:,3); 
0017 end; 
0018

Generated on Tue 23-May-2017 20:00:55 by m2html © 2005