<p dir="ltr">Thanks, Makoto,<br>
indeed, I forgot about the numeric case as I always work with string types.</p>
<p dir="ltr">Good to hear everything is working well, Rafał.<br>
For the sake of completeness you could change the part that looks for correct markers to:</p>
<p dir="ltr">if ischar(EEG.event(1).type)<br>
% look for 'correct' markers:<br>
tps = {EEG.event.type};<br>
corr_tp = find(strcmp('1', tps));<br>
else<br>
corr_tp = find( [EEG.event.type] == 1);<br>
end<br>
</p>
<div class="gmail_quote">7 paź 2014 22:48 "Makoto Miyakoshi" <<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>> napisał(a):<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Rafal,<div><br></div><div>Check whether your event markers are string or numeric... Mikolaj's code assumes they are string, but I know users often have numeric event markers.</div><div><br></div><div>By the way Mikolaj's code is wonderful as always.</div><div><br></div><div>Makoto</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 12:52 AM, Rafał Jończyk <span dir="ltr"><<a href="mailto:rafal.jonczyk@gmail.com" target="_blank">rafal.jonczyk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div><div><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></div></div><span>-- <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>
</span></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div>
</div></div>
</blockquote></div>