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

cevent_before_event

PURPOSE ^

SYNOPSIS ^

function [a_cevent]= cevent_before_event(time,cevent);

DESCRIPTION ^

 give a timestamp, find a previous single event in a cevent/event.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function  [a_cevent]= cevent_before_event(time,cevent);
0002 %
0003 % give a timestamp, find a previous single event in a cevent/event.
0004 %
0005 a_cevent = [];
0006 [list] = find(cevent(:,2)<= time);
0007 [temp index] =  max(cevent(list,1));
0008 index2 = list(index);
0009 if ~isempty(index2)
0010   a_cevent = cevent(index2,:);
0011 end;

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