[Eeglablist] Save epoch subsets

Andreas Widmann widmann at uni-leipzig.de
Tue Apr 10 05:48:53 PDT 2018


You overwrite your "mother" dataset:
> EEG = pop_select( EEG,'trial',[1:30] );

Try:
EEG = pop_loadbva(filliste(n).name);
TMP = pop_select( EEG,'trial',[1:30] );
pop_saveset( TMP, 'filename',new_filename,'filepath',savedir);
TMP = pop_select( EEG,'trial',[31:60] );
...


Hope this helps! Best,
Andreas

> Am 06.04.2018 um 08:07 schrieb Dagfinn Matre <Dagfinn.Matre at stami.no>:
> 
> Dear EEGLAB experts,
>  
> Using a matlab script, I would like to split an epoched file with say 90 epochs into subset 1 (epoch 1:30), subset 2 (31:60), subset 3 (61:90), and save these subsets in separate set-files.
>  
> It works fine for the first subset with this code:
>  
> EEG = pop_loadbva(filliste(n).name);
> EEG = eeg_checkset( EEG );
> EEG = pop_select( EEG,'trial',[1:30] );
> EEG = eeg_checkset( EEG );
> [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'setname','temp','gui','off');
> EEG = pop_saveset( EEG, 'filename',new_filename,'filepath',savedir);
>  
> The problem appears when I want to re-select the mother dataset containing all epochs in order to select the next subset. Using the GUI and saving the eeglabhist.m indicates that this is the next line of code,
>  
> [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'retrieve',1,'study',0);
>  
> but when I continue with this line, selecting the next trials, matlab returns “Error: dataset is empty”.
>  
> EEG = pop_select( EEG,'trial',[31:60] );
>  
> Any ideas anyone?
>  
> Best,
> Dagfinn Matre
>  
>  
> _______________________________________________
> 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