[Eeglablist] Extract epochs

James Desjardins jdesjardins at brocku.ca
Fri Mar 11 19:15:30 PST 2011


Hello,

If the event type labels are stored as string rather than numeric the  
code you provided would not work. If you know that your event type  
labels are numeric you can ignore the rest of this message.

To check if they are numeric copy the following line to your command line:

find([EEG.event.type]==20)

If there are type "20" events in the currently loaded dataset and this  
call returns an empty matrix your event type labels are probably  
strings. In this case your use of "=="s should be replaced with calls  
to "strcmp" as follows:

Change instances such as this:

if (EEG.event(i).type==40 ...

To this:

if (strcmp(EEG.event(i).type,'40') ...


I hope that this helps


James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676


Quoting aarjona at us.es:

> Hello.
>
> I´d like to extract epochs with eeglab, but no all epochs only some   
> of them. Nevertheless, I only can extract all epochs of the record   
> using tools-extract epochs. I have done one script, but it doesn´t   
> work:
>
> for i=1:length(EEG.event)-1
>
>     if (EEG.event(i).type==40 & EEG.event(i+1).type==44 &   
> EEG.event(i+2).type==4)
>         EEG.event(i).type=4044;    % cond. Val.Der
>     end;
>     if (EEG.event(i).type==20 & EEG.event(i+1).type==22 &   
> EEG.event(i+2).type==2)
>         EEG.event(i).type=2022;   % cond. Val.Izq
>     end;
>     if (EEG.event(i).type==40 & EEG.event(i+1).type==22 &   
> EEG.event(i+2).type==2)
>         EEG.event(i).type=4022;   % cond. Inval.Der
>     end;
>     if (EEG.event(i).type==20 & EEG.event(i+1).type==44 &   
> EEG.event(i+2).type==4)
>        EEG.event(i).type=2044;   % cond. Inval.Izq
>     end;
> end;
>
> EEG = pop_epoch( EEG, {'4044' '2022' '4022' '2044'}, [-0.2            
>  2], 'newname', 'EEProbe continuous data epochs', 'epochinfo', 'yes');
>
> Thank you very much everyone
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to  
>  eeglablist-request at sccn.ucsd.edu
>







More information about the eeglablist mailing list