[Eeglablist] insert events after some markers in EEG data

Elisa Tatti elisatatti at msn.com
Sun Oct 2 06:32:38 PDT 2016


Dear EEGLAB users,
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".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):
%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');


I am starting learning matlab now, so I don't know how to adapt this script to my data. Can someone help me?!
Thank you for your consideration.

Elisa
 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20161002/92f462b8/attachment.html>


More information about the eeglablist mailing list