[Eeglablist] Reject random epoch

Stephen Politzer-Ahles politzerahless at gmail.com
Tue Apr 9 11:42:16 PDT 2013


Hi Carlos,

The MATLAB function randsample() can get random numbers. So you could use
that, in combination with the pop_rejepoch() function, to randomly remove
some epochs. If you want to do this many times, just use a 'for' loop to
repeat it over and over again.

num_epochs = size(EEG.data, 3); % Find the number of epochs
num_toreject = 5; % Some number of epochs to reject per file; you can set
this to any integer you want
epochs_to_reject = randsample( 1:num_epochs, num_to_reject ) % Get some
random epoch indices (without replacement)
EEG = pop_rejepoch( EEG, epochs_to_reject, 0 ); % remove those epochs

Best,
Steve


On Tue, Apr 9, 2013 at 8:44 AM, Carlos CEVALLOS <ccevallo at ulb.ac.be> wrote:

> Good Day****
>
> ** **
>
> In order to analyze files in a study it needs epoch consistency so I am
> looking for a way of rejecting epochs randomly. I have already rejected bad
> epochs but now I have to make all data point consistent with each other.
> Could you help me with a script or an advise on how could I do this? ****
>
> ** **
>
> Thanks in advance,****
>
> ** **
>
> Carlos CEVALLOS****
>
> _______________________________________________
> 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
>



-- 
Stephen Politzer-Ahles
University of Kansas
Linguistics Department
http://people.ku.edu/~sjpa/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130409/7d096aeb/attachment.html>


More information about the eeglablist mailing list