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

cevent2cstream

PURPOSE ^

cevent2cstream Generte stream from event

SYNOPSIS ^

function res = cevent2cstream(cevent,start_time,interval,default, end_time)

DESCRIPTION ^

 cevent2cstream   Generte stream from event

 Warning:
 Note that this is a lossy conversion: if there are overlapping events in
 the cevent, then only one of them will come through in the cstream.

 res = cevent2cstream(cevent,start_time,interval,default)
 cevent:  input cevent data
 start_time: the timestamp when the converted cstream starts.
 interval: the interval between two consecutive time stamps of converted
           cstream data.
 default:  the default value for converted cstream data
 end_time: (optional) the timestamp when the converted cstream ends.
 res:      the converted cstream

 Example 1:
 s = cevent2cstream(cevent_speech,results(sbjID).speechTime,0.001,0);

 Was: Copy from Ikhyun's function, make_cstream_from_cevent. Feb 19, 2009
 Now: calls ruj_cevent2cstream because the old version had a floating
 point error accumulation error

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function res = cevent2cstream(cevent,start_time,interval,default, end_time)
0002 % cevent2cstream   Generte stream from event
0003 %
0004 % Warning:
0005 % Note that this is a lossy conversion: if there are overlapping events in
0006 % the cevent, then only one of them will come through in the cstream.
0007 %
0008 % res = cevent2cstream(cevent,start_time,interval,default)
0009 % cevent:  input cevent data
0010 % start_time: the timestamp when the converted cstream starts.
0011 % interval: the interval between two consecutive time stamps of converted
0012 %           cstream data.
0013 % default:  the default value for converted cstream data
0014 % end_time: (optional) the timestamp when the converted cstream ends.
0015 % res:      the converted cstream
0016 %
0017 % Example 1:
0018 % s = cevent2cstream(cevent_speech,results(sbjID).speechTime,0.001,0);
0019 %
0020 % Was: Copy from Ikhyun's function, make_cstream_from_cevent. Feb 19, 2009
0021 % Now: calls ruj_cevent2cstream because the old version had a floating
0022 % point error accumulation error
0023 %
0024 if ~exist('end_time', 'var')
0025     end_time = cevent(end,2);
0026 end
0027 
0028 if ~exist('default', 'var')
0029     default = 0;
0030 end
0031 
0032 res = ruj_cevent2cstream(cevent, start_time:interval:end_time, default);
0033 
0034

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