[Eeglablist] How can I epoch events followed by correct response only?

Rafał Jończyk rafal.jonczyk at gmail.com
Tue Oct 7 00:52:58 PDT 2014

Hej Mikołaj,

Thank you so much for your help! The script makes perfect sense, but,
somehow, Matlab tells me that the epoch range is empty.
'pop_epoch(): empty epoch range (no epochs were found).'
I checked the 'EEG.event' and 'EEG.event.type', and everything looks fine
there. Moreover, in each and every case an event of interest is followed
either by '1' (correct) or by '2' (incorrect), so this script should be
working easily.
I don't think there is something wrong with the event list as it has been
working so far when I epoched the data with a bigger time limit [-0.105
2.5] to "grasp" the event and correct response triggers in one epoch, run
the ICA, and later epoch the data again in erplab with time limit [-0.1 1].
Maybe it does not recognize the line that it should epoch to the trigger
before '1' (prev_ev = corr_tp - 1;)?


2014-10-04 0:42 GMT+02:00 Mikołaj Magnuski <imponderabilion at gmail.com>:

> Hej Rafał,
> I think the most straightforward way would be to find event indices that
> are followed by events marking correct response. Then you can use these
> event indices to epoch the data.
> If your correct response events are of type '1' (EEG.event.type) as you
> suggest you can try the following:
> % set the epoching limis:
> ep_lim = [-0.2, 0.7];
> % look for 'correct' markers:
> tps = {EEG.event.type};
> corr_tp = find(strcmp('1', tps));
> % the following step assumes that all correct responses are preceded with
> events that you want to epoch you data with, this may not necassarily be
> the case
> prev_ev = corr_tp - 1;
> % epoch with respect to event just before correct markers:
> EEG = pop_epoch( EEG, {}, ep_lim, 'eventindices', prev_ev);

Rafał Jończyk, MA
Interdisciplinary PhD Program: Language, Society, Technology and Cognition
Faculty of English
Adam Mickiewicz University, Poznań
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20141007/a7c3475b/attachment.html>

More information about the eeglablist mailing list