<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><div dir="ltr"><font size="3">Dear EEGLAB users,</font><div><font size="3"><br></font></div><div><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 21.3px;"><font size="3">We have EEG recordings with several markers and I would like to add an event coded "33" 2.5 seconds after the onset of all the events "13".</font></span></span></div><div><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 21.3px;"><font size="3">In the EEGLABlist I read about a script to add events on the base of an already existent one but it doesn't work on my data (A_latencies is empty). I suppose that this is because my events are coded as numbers and the examples provided here were with "characters" (see below):</font></span></span></div><div><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 21.3px;"><font size="3"><br></font></span></span></div><div><pre style="white-space: pre-wrap;"><font size="3">%Get the latencies (data point indices) for all 'A' type events...
A_latencies=[EEG.event(find(strcmp('A',{EEG.event.type}))).latency];
%for each A_latencies add a new event type '1' with a latency of (A_latencies(i)+1.5*EEG.srate)-1...
for i=1:length(A_latencies);
n_events=length(EEG.event);
EEG.event(n_events+1).type='1';
EEG.event(n_events+1).latency=(A_latencies(i)+1.5*EEG.srate)-1;
EEG.event(n_events+1).urevent=n_events+1;
end
%check for consistency and reorder the events chronologically...
EEG=eeg_checkset(EEG,'eventconsistency');
</font></pre></div><div><font size="3"><br></font></div><div><span style="background-color: rgb(255, 255, 255);"><span style="line-height: 21.3px;"><font size="3"><br></font></span></span></div><div><span style="line-height: 21.3px; background-color: rgb(255, 255, 255);"><font size="3">I am starting learning matlab now, so I don't know how to adapt this script to my data. Can someone help me?!</font></span></div><div><font size="3"><br></font></div><div><span style="line-height: 21.3px;"><font size="3">Thank you for your consideration.</font></span></div><div><span style="line-height: 21.3px;"><font size="3"><br></font></span></div><div><span style="line-height: 21.3px;"><font size="3"><br></font></span></div><div><span style="line-height: 21.3px;"><font size="3">Elisa</font></span></div><div><font color="#444444"><span style="font-size:15px;line-height:21.3px;"><br></span></font></div> </div></div><style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style> </div></body>
</html>