<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Karlo,<br>
<br>
Once you load a data set, executing the following script at the command line should add the events that you are looking for...<br>
<br>
%Get the latencies (data point indices) for all 'A' type events...<br>
<font face="Courier New">A_latencies=[EEG.event(find(strcmp('A',{EEG.event.type}))).latency];<br>
<br>
%for each A_latencies add a new event type '1' with a latency of </font><font face="Courier New"><font face="Courier New">(A_latencies(i)+1.5*EEG.srate)-1...<br>
</font>for i=1:length(A_latencies);<br>
n_events=length(EEG.event);<br>
EEG.event(n_events+1).type='1';<br>
EEG.event(n_events+1).latency=(A_latencies(i)+1.5*EEG.srate)-1;<br>
EEG.event(n_events+1).urevent=n_events+1;<br>
end<br>
<br>
%check for consistency and reorder the events chronologically...<br>
EEG=eeg_checkset(EEG,'eventconsistency');<br>
</font><br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText">James</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF613020"><font size="2" color="#000000" face="Tahoma"><b>From:</b> eeglablist-bounces@sccn.ucsd.edu [eeglablist-bounces@sccn.ucsd.edu] on behalf of karlo gonzales [thats_karlo@yahoo.com]<br>
<b>Sent:</b> February 5, 2015 5:16 PM<br>
<b>To:</b> EEGLAB List<br>
<b>Subject:</b> [Eeglablist] add events to the EEG data<br>
</font><br>
</div>
<div></div>
<div>
<div style="color:#000; background-color:#fff; font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size:16px">
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">Hi, </div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">We have an EEG data with several events, which marked as 'A' and repeated every 5 sec. </div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">what i am looking for is a way to add extra events to the data such as event '1' and appears 1.5 sec after event 'A'. </div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">i am looking forward to hear from you.</div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">Thanks in advance,</div>
<div id="yui_3_16_0_1_1423157021096_41103" dir="ltr">Karlo</div>
</div>
</div>
</div>
</div>
</body>
</html>