[Eeglablist] Dividing datasets into halves

James Desjardins jdesjardins at brocku.ca
Fri Nov 22 10:33:47 PST 2013


Hi Magda,

I avoid the used of the reserved term "end" in array indexing whenever possible as I find it often results in unexpected complications. The modifications to your example that I would use are as follows...

%First half:
EEG = pop_select( EEG,'trial',[1:floor(EEG.trials/2)]);

%Second half
EEG = pop_select( EEG,'trial',[floor(EEG.trials/2)+1:EEG.trials] );



James Desjardins, MA
Electrophysiology Technologist
Cognitive and Affective Neuroscience Lab, Psychology Department
Jack and Nora Walker Centre for Lifespan Development Research
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada L2S 3A1
905-688-5550 x4676
--
"'Cause you never can tell What goes on down below!
"This pool might be bigger Than you or I know!"

McElligot's Pool
Dr.Seuss 1947
________________________________
From: eeglablist-bounces at sccn.ucsd.edu [eeglablist-bounces at sccn.ucsd.edu] on behalf of Magda Gawłowska [mag.gawlowska at gmail.com]
Sent: November-20-13 10:26 PM
To: Arnaud Delorme
Cc: eeglablist
Subject: Re: [Eeglablist] Dividing datasets into halves

Dear Arno,

Thank you for the tip - to be honest, I'm doing it like that from the very begining, but the problem lays in determining the number of epochs I want to select, eg.:

When I use command form GUI i have to type in the range of epochs for the 1st half of dataset and for the 2nd half od dataset - like below - form 1st to 48th, - which is the 1st half of my dataset (in that case I have 98 epochs in total)

EEG = pop_select( EEG,'trial',[1:48] );

I wanted to script this step for multiple subjects and every subect has different number of epochs in dataset - so obviously I cannot leave it as [1:48].

I tried the easiest possible way to solve it, by tiping in [1:end/2] for the 1st half and [end/2:end] for the 2nd - but it doesn't work... Do you maybe have any other idea how can I specify the range of epochs? :):)

Thank you once again!

Magda


2013/11/20 Arnaud Delorme <arno at ucsd.edu<mailto:arno at ucsd.edu>>
Dear Magda,

after you use the EEGLAB graphic interface to divide your dataset, look at the EEGLAB history using the "eegh" command. The last line will contain the command you will need to perform the same operation in a script.

Best,

Arno

On Nov 11, 2013, at 4:42 AM, Magda Gawłowska <mag.gawlowska at gmail.com<mailto: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<mailto: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<mailto:eeglablist-request at sccn.ucsd.edu>




--
Pozdrawiam!

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


More information about the eeglablist mailing list