[Eeglablist] How to randomly delete half the epochs (trials) associated with specific EEG triggers?

Clement Lee cll008 at eng.ucsd.edu
Sat Sep 5 16:17:52 PDT 2020


Hi Renzo,

Maybe someone has a solution, but in the meantime you can try the following:
First index the stimulus by checking EEG.event.type, then loop over
randperm(length(index), [1 length(index)/2]) to create pseudo random
indices, and use those indices to get the data for further processing
EEG.data(:, :, randomIdx). (or use randomIdx to pop_select / remove data)

Best,
Clement Lee
Applications Programmer
Swartz Center for Computational Neuroscience
Institute for Neural Computation, UC San Diego
858-822-7535


On Sat, Sep 5, 2020 at 4:15 PM Renzo Lanfranco <renzo.lanfranco at gmail.com>
wrote:

> Hi everyone,
>
>
>
> I have a number of epoched (and clean) eeglab datasets ready to analyse.
> However, I need to randomly delete half the trials (epochs) of two specific
> conditions (marked by EEG triggers) for an analysis. Does anyone have lines
> of code that can do so? For example, a Matlab code where you can specify
> EEG triggers (e.g. ‘5’ and ‘6’), so the script takes all the trials that
> contain those triggers and randomly deletes half of them from the dataset?
>
>
>
> Thanks!
>
> Renzo
> _______________________________________________
> 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