[Eeglablist] Can I manually reorganise the order of trials within set files and save them?

Stephen Politzer-Ahles spa268 at nyu.edu
Thu Apr 30 05:05:41 PDT 2015

Hi Carolin,

Have you tried running this code to see if it actually does re-order your
events? It should be fairly straightforward to check (i.e., see what the
event values for the first few trials are before and after running your
'list 2' code).

If that doesn't work, I imagine it should be easy to do manually by just
re-ordering the indices of all the relevant data structures, e.g.:
order = [2 5 6 1 4 8 9 7 3];
EEG.data = EEG.data(:,:,order);
EEG.epoch = EEG.epoch{order};
% etc...

There may also be built-in functions in EEGLAB or ERPLAB that do this, but
I'm not aware of any myself.


Stephen Politzer-Ahles
New York University, Abu Dhabi
Neuroscience of Language Lab

On Tue, Apr 28, 2015 at 6:15 PM, Carolin Sievers (PSY) <
Carolin.Sievers at uea.ac.uk> wrote:

>  Hello EEGlab community,
>  I am trying to reorganise the order of trials in my EEG .set files.
> I was hoping to use the following function:
> EEG = pop_selectevent( EEG, 'epoch',[]
> ,'deleteevents','off','deleteepochs','on','invertepochs','off');
>  If I put in parentheses the trials I would like to include, in the order
> I would like them to be in in a new .set file, will this work?
>  If this is unclear, here some more details:
> Based on behavioural data, we create two or more sub-sets from one EEG
> recording. However, within these sub-sets, the order in which stimuli were
> presented is not the same. Is there a way for me to reorganise the order of
> trials and save that order in a new .set file? E.g.,
>  List 1
> EEG = pop_selectevent( EEG, 'epoch',[1:9]
> ,'deleteevents','off','deleteepochs','on','invertepochs','off');
>  List 2
> EEG = pop_selectevent( EEG, 'epoch',[2 5 6 1 4 8 9 7 3]
> ,'deleteevents','off','deleteepochs','on','invertepochs','off');
>  Thank you very much for your help.
>   Best wishes,
>  Carolin
> _____________
>  Carolin Sievers (PSY)
> PhD Student
> School of Psychology
>  LSB 0.109
>  University of East Anglia
>  Norwich, NR47TJ
>  https://www.uea.ac.uk/psychology/people/profile/carolin-sievers
> Carolin.Sievers at uea.ac.uk
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150430/8eb4adb9/attachment.html>

More information about the eeglablist mailing list