<div dir="ltr">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:<br><br>[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;<br>EEG = pop_loadcnt('S:\Dropbox\TonalProbabilityN400\eegdata\pilot\newpilot003\newpilot003 Data.cnt' , 'dataformat', 'auto', 'memmapfile', '');<br>[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 0,'gui','off'); <br>EEG = pop_loadcnt('S:\Dropbox\TonalProbabilityN400\eegdata\pilot\newpilot004\newpilot004 Data.cnt' , 'dataformat', 'auto', 'memmapfile', '');<br>[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'gui','off'); <br>EEG = eeg_checkset( EEG );<br>EEG = pop_mergeset( ALLEEG, [1  2], 0);<br>[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'gui','off'); <br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><span><div>---<br></div>Stephen Politzer-Ahles<br>The Hong Kong Polytechnic University<br>Department of Chinese and Bilingual Studies<br><a href="http://www.mypolyuweb.hk/~sjpolit/" target="_blank">http://www.mypolyuweb.hk/~sjpolit/</a></span><a href="http://www.nyu.edu/projects/politzer-ahles/" target="_blank"></a></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Sat, May 20, 2017 at 1:03 AM, Joseph Nuamah <span dir="ltr"><<a href="mailto:jknuamah@aggies.ncat.edu" target="_blank">jknuamah@aggies.ncat.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I am using pop_mergeset to concatenate four epoched datasets from the same participant.</div><div><br></div><div>I am able to achieve that with the GUI in EEGLAB. </div><div><br></div><div>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. </div><div><br></div><div>Please find the code below:</div><div><br></div><div>==============================<wbr>==============================<wbr>=========</div><div><br></div><div>dpath = 'D:\\MATLAB\\eeglab\\G1\\';</div><div><br></div><div>EEG = pop_loadset('filename','<wbr>Block1.set','filepath',dpath );</div><div>EEG = eeg_checkset( EEG );</div><div>%clear('EEG')</div><div>EEG = pop_loadset('filename','<wbr>Block2.set','filepath',dpath );</div><div>EEG = eeg_checkset( EEG );</div><div>%clear('EEG')</div><div>EEG = pop_loadset('filename','<wbr>Block3.set','filepath',dpath );</div><div>EEG = eeg_checkset( EEG );</div><div>%clear('EEG')</div><div>EEG = pop_loadset('filename','<wbr>Block4.set','filepath',dpath );</div><div>EEG = eeg_checkset( EEG );</div><div>%clear('EEG')</div><div><br></div><div>EEG = pop_mergeset( ALLEEG, [1  2  3  4], 0);</div><div>EEG.setname='P1';</div><div>EEG = eeg_checkset( EEG );</div><div>EEG = pop_saveset( EEG, 'filename','P1.set','filepath'<wbr>,'D:\\MATLAB\\eeglab\\G1\\P1\\<wbr>');</div><div>EEG = eeg_checkset( EEG );</div><div><br></div><div>eeglab redraw;</div><div>==============================<wbr>==============================<wbr>==========</div><div><br></div><div><br></div><div><br></div><div><br></div><div>This is the error message:</div><div><br></div><div>==============================<wbr>==============================<wbr>==========</div><div><br></div><div>Error using pop_mergeset (line 54) needs at least two datasets</div><div><br></div><div>Error in LoadFiles (line 18) EEG = pop_mergeset( ALLEEG, [1  2  3  4],0);</div><div>==============================<wbr>==============================<wbr>==========</div><div><br></div><div><br></div><div><br></div><div>Please help !</div><div><br></div><div>Thanks.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Joseph.</div><div> </div></font></span></div>
<br>______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/<wbr>eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.<wbr>ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.<wbr>edu</a><br></blockquote></div><br></div>