<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.abn
        {mso-style-name:abn;}
span.aqj
        {mso-style-name:aqj;}
span.sew5ln35npik6y4
        {mso-style-name:sew5ln35npik6y4;}
span.sew80zv60qjwi4r
        {mso-style-name:sew80zv60qjwi4r;}
span.EpostStil21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NO-BOK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Eric<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks, this worked perfectly!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Also, thanks to Andreas Widmann, who basically proposed the same solution.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Dagfinn<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Fra:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Eric Rawls [mailto:elrawls@email.uark.edu]
<br>
<b>Sendt:</b> mandag 9. april 2018 19.51<br>
<b>Til:</b> Dagfinn Matre <Dagfinn.Matre@stami.no><br>
<b>Kopi:</b> eeglablist@sccn.ucsd.edu<br>
<b>Emne:</b> Re: [Eeglablist] Save epoch subsets<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">This is because you replace the original dataset with the new set in
</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">EEG = pop_select( EEG,</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'trial'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,[<span class="aqj">1:30</span>]
 );</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">Instead try</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">%Load File</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:black">EEG = pop_loadbva(filliste(n).name);</span><span lang="EN-US" style="color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:black">%Create new sets containing only the selected trials</span><span lang="EN-US" style="color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:black">EEG1 = pop_select( EEG,</span><span lang="EN-US" style="color:#A020F0">'trial'</span><span lang="EN-US" style="color:black">,[<span class="aqj">1:30</span>]
 );</span><span lang="EN-US" style="color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="color:black">EEG2 = pop_select( EEG,</span><span lang="EN-US" style="color:#A020F0">'trial'</span><span lang="EN-US" style="color:black">,[31:60] );</span><span lang="EN-US" style="color:#222222"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">EEG3 = pop_select( EEG,</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'trial'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,[61:90] );</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">%Save these sets</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">EEG1 = pop_saveset( EEG1, </span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filename'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,'EEG_1',</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filepath'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,savedir);</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">EEG2 = pop_saveset( EEG2, </span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filename'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,'EEG_2',</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filepath'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,savedir);</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#222222"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">EEG3 = pop_saveset( EEG3, </span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filename'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,'EEG_3',</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#A020F0">'filepath'</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">,savedir);</span><span lang="EN-US" style="font-family:"Arial",sans-serif;color:#222222"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">This way you never replace the main EEG set.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">E</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">Eric Rawls</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Arial",sans-serif;color:black">University of Arkansas</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Apr 6, 2018 at 1:07 AM, Dagfinn Matre <<a href="mailto:Dagfinn.Matre@stami.no" target="_blank">Dagfinn.Matre@stami.no</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear EEGLAB experts,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">It works fine for the first subset with this code:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = pop_loadbva(filliste(n).name);</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = eeg_checkset( EEG );</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = pop_select( EEG,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'trial'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,[1:30]
 );</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = eeg_checkset( EEG );</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'setname'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'temp'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'gui'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'off'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = pop_saveset( EEG,
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'filename'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,new_filename,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'filepath'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,savedir);</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">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, </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'retrieve'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,1,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'study'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,0);</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">but when I continue with this line, selecting the next trials, matlab returns “Error: dataset is empty”.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none">
<span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">EEG = pop_select( EEG,</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'trial'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">,[31:60]
 );</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Any ideas anyone?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Best,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Dagfinn Matre</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">
http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">
eeglablist-unsubscribe@sccn.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.edu</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>