[Eeglablist] Unable to concatenate four epoched datasets with pop_mergeset

Stephen Politzer-Ahles politzerahless at gmail.com
Fri May 19 10:18:43 PDT 2017


It looks like you're overwriting each of your EEG datasets when you load a
new one, so you really only have one dataset in memory, not four. Your
script doesn't seem to have the pop_newset() command in there to store the
new EEG datasets into ALLEEG. The easiest way to do it is to do it once
manually and then use the `eegh` command to get the equivalent code. For
example, this is the code I get after loading and concatenating two files
manually:

[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG =
pop_loadcnt('S:\Dropbox\TonalProbabilityN400\eegdata\pilot\newpilot003\newpilot003
Data.cnt' , 'dataformat', 'auto', 'memmapfile', '');
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 0,'gui','off');
EEG =
pop_loadcnt('S:\Dropbox\TonalProbabilityN400\eegdata\pilot\newpilot004\newpilot004
Data.cnt' , 'dataformat', 'auto', 'memmapfile', '');
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'gui','off');
EEG = eeg_checkset( EEG );
EEG = pop_mergeset( ALLEEG, [1  2], 0);
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'gui','off');


---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.mypolyuweb.hk/~sjpolit/
<http://www.nyu.edu/projects/politzer-ahles/>

On Sat, May 20, 2017 at 1:03 AM, Joseph Nuamah <jknuamah at aggies.ncat.edu>
wrote:

> Hello everyone,
>
> I am using pop_mergeset to concatenate four epoched datasets from the same
> participant.
>
> I am able to achieve that with the GUI in EEGLAB.
>
> However, I am unable to do that with the Matlab script below. The error I
> receive tells me the array of all loaded datasets, ALLEEG, is empty.
>
> Please find the code below:
>
> =====================================================================
>
> dpath = 'D:\\MATLAB\\eeglab\\G1\\';
>
> EEG = pop_loadset('filename','Block1.set','filepath',dpath );
> EEG = eeg_checkset( EEG );
> %clear('EEG')
> EEG = pop_loadset('filename','Block2.set','filepath',dpath );
> EEG = eeg_checkset( EEG );
> %clear('EEG')
> EEG = pop_loadset('filename','Block3.set','filepath',dpath );
> EEG = eeg_checkset( EEG );
> %clear('EEG')
> EEG = pop_loadset('filename','Block4.set','filepath',dpath );
> EEG = eeg_checkset( EEG );
> %clear('EEG')
>
> EEG = pop_mergeset( ALLEEG, [1  2  3  4], 0);
> EEG.setname='P1';
> EEG = eeg_checkset( EEG );
> EEG = pop_saveset( EEG, 'filename','P1.set','filepath'
> ,'D:\\MATLAB\\eeglab\\G1\\P1\\');
> EEG = eeg_checkset( EEG );
>
> eeglab redraw;
> ======================================================================
>
>
>
>
> This is the error message:
>
> ======================================================================
>
> Error using pop_mergeset (line 54) needs at least two datasets
>
> Error in LoadFiles (line 18) EEG = pop_mergeset( ALLEEG, [1  2  3  4],0);
> ======================================================================
>
>
>
> Please help !
>
> Thanks.
>
> Joseph.
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20170520/e4ac10d9/attachment.html>


More information about the eeglablist mailing list