[Eeglablist] Dividing datasets into halves

Magda Gawłowska mag.gawlowska at gmail.com
Wed Nov 13 15:53:37 PST 2013


Thank you! But it doesnt work exactly as I want it to... the script does
sth strange... e.g. I have a dateset with 98 epochs, In every epoch I have
2 events (196 events in total). When I run the script the outputs are two
datasets with 46 epochs, but still with 196 events... which is odd, because
theoreticaly i should have 46 epochs and 98 events... But I will try to
figure it out somehow :):)

Thak you once again!

Magda


2013/11/13 jfochoaster . <jfochoaster at gmail.com>

> Dear Magda, I use the following lines when I was trying the split-half
> approach
>
> If you have loaded one dataset
>
>     EEG_even = EEG;
>
>     %se crea el dataset par
>     [channels samples epochs] = size(EEG.data);
>
>     EEG_even.data = EEG_even.data(:,:,2:2:epochs);
>
>     [channels samples epochs] = size(EEG_even.data);
>
>     EEG_even.trials = epochs;
>
>     EEG_even.epoch = {};
>
>     [EEG_even,changes] = eeg_checkset(EEG_even);
>
>     pop_saveset(EEG_even,'filepath',EEG.filepath,'filename',[ EEG.setname
> '_even.set']);
>
>     EEG_odd = EEG;
>
>     [channels samples epochs] = size(EEG.data);
>
>     EEG_odd.data = EEG_odd.data(:,:,1:2:epochs);
>
>     [channels samples epochs] = size(EEG_odd.data);
>
>     EEG_odd.trials = epochs;
>
>     EEG_odd.epoch = {};
>
>     [EEG_odd,changes] = eeg_checkset(EEG_odd);
>
>     pop_saveset(EEG_odd,'filepath',EEG.filepath,'filename',[ EEG.setname
> '_odd.set']);
>
> I hope this works for you
>
> Best
>
>
>
> On Mon, Nov 11, 2013 at 7:42 AM, Magda Gawłowska <mag.gawlowska at gmail.com>wrote:
>
>> Dear EEGlab Users,
>>
>> I'm quite new to Matlab scripting as I was previously using only GUI
>> version of EEGLab. I was wondering if you can help me with scripting
>> problem. I suppose it's not very complicated, but I have a hard time with
>> finding the solution.
>>
>> So, here we go - I  have segmented datasets with different number of
>> events in each one. I wanted to divide sets into halves and save them as
>> the 1st and the 2nd half. Up until now I've been doing it by simply using:
>> Eidt -> select data -> epoch range, but it takes ages to do it manually. Is
>> there any way to do it using script, so that Matlab checks number of events
>> in every dataset at first, and then takes the 1st and 2nd half separately?
>>
>> I would be grateful for any help!
>>
>> Greetings,
>>
>>
>> Magda
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> John Ochoa
> Docente de Bioingeniería
> Universidad de Antioquia
>



-- 
Pozdrawiam!

Magda Gawłowska
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20131114/0a80895e/attachment.html>


More information about the eeglablist mailing list