<div dir="ltr"><div><div><div><div><div>Hej Mikołaj,<br><br></div>Thank you so much for your help! The script makes perfect sense, but, somehow, Matlab tells me that the epoch range is empty. <br>'pop_epoch(): empty epoch range (no epochs were found).'<br></div>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.<br></div>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].<br></div>Maybe it does not recognize the line that it should epoch to the trigger before '1' (prev_ev = corr_tp - 1;)?<br><br></div><div>Best,<br>Rafał<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-04 0:42 GMT+02:00 Mikołaj Magnuski <span dir="ltr"><<a href="mailto:imponderabilion@gmail.com" target="_blank">imponderabilion@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hej Rafał,</div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If your correct response events are of type '1' (EEG.event.type) as you suggest you can try the following:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">% set the epoching limis:</div><div class="gmail_extra">ep_lim = [-0.2, 0.7];</div><div class="gmail_extra">% look for 'correct' markers:</div></div><div class="gmail_extra">tps = {EEG.event.type};</div><div class="gmail_extra">corr_tp = find(strcmp('1', tps));</div><div class="gmail_extra">% 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</div><div class="gmail_extra">prev_ev = corr_tp - 1;</div><div class="gmail_extra">% epoch with respect to event just before correct markers:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">EEG = pop_epoch( EEG, {}, ep_lim, 'eventindices', prev_ev);</div></div><div class="gmail_extra"><br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div>Rafał Jończyk, MA</div><div>Interdisciplinary PhD Program: Language, Society, Technology and Cognition</div><div>Faculty of English</div><div>Adam Mickiewicz University, Poznań</div><div>Poland</div>
</div>