<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#000000;font-family:Verdana, Geneva, sans-serif;" dir="ltr">
<p>Hi all,</p>
<p><br>
</p>
<p>I am not sure if this is a bug or a stupid error on my end:</p>
<p>I have 25-s epochs, of which I want to use the first 2000ms as baseline, and then ignore the first 5 seconds for analysis.</p>
<p>As far as I understand this cannot be done in one line of code, so I've done it like this:</p>
<p><br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);">
<span style="color: rgb(0, 0, 0); font-size: 10pt;">labels = { </span><span style="font-size: 10pt;">'AAAA'</span><span style="color: rgb(0, 0, 0); font-size: 10pt;"> 
</span><span style="font-size: 10pt;">'AAAB'</span><span style="color: rgb(0, 0, 0); font-size: 10pt;"> 
</span><span style="font-size: 10pt;">'AAAC'}</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
<span style="font-size: 10pt;">EEG_all = pop_epoch(EEG, labels, [0  </span><span style="font-size: 10pt;">25],
</span><span style="color: rgb(178, 69, 243); font-size: 10pt;">'newname'</span><span style="font-size: 10pt;">,
</span><span style="color: rgb(178, 69, 243); font-size: 10pt;">'all epochs'</span><span style="font-size: 10pt;">,
</span><span style="color: rgb(178, 69, 243); font-size: 10pt;">'epochinfo'</span><span style="font-size: 10pt;">,
</span><span style="color: rgb(178, 69, 243); font-size: 10pt;">'yes'</span><span style="font-size: 10pt;">);</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
<span style="font-size: 10pt;">EEG_all = pop_rmbase(EEG_all, [0 2000]);</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(178, 69, 243);">
<span style="font-size: 10pt;"></span><span style="font-size: 10pt;"></span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
<span style="font-size: 10pt;">EEG_all = pop_epoch(EEG_all, labels, [7 25]);</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-size: 10px; line-height: normal; font-family: Courier;">
<br>
</p>
<div><br>
</div>
<div>Weirdly, when doing this I loose the first trial out of every data set at the last step (So: 80 epochs after removing the baseline, 79 epochs left after re-epoching. It's a different trial every time since randomized).</div>
<div>
<div><br>
</div>
<div>Some output:</div>
<div><br>
</div>
<div>EEG.event</div>
<div><br>
</div>
<div>ans = </div>
<div><br>
</div>
<div>1x79 struct array with fields:</div>
<div><br>
</div>
<div>    type</div>
<div>    latency</div>
<div>    urevent</div>
<div>    epoch</div>
</div>
<div><br>
</div>
<div>
<div>EEG.epoch</div>
<div><br>
</div>
<div>ans = </div>
<div><br>
</div>
<div>1x80 struct array with fields:</div>
<div><br>
</div>
<div>    event</div>
<div>    eventtype</div>
<div>    eventlatency</div>
<div>    eventurevent</div>
</div>
<div><br>
</div>
<div>EEG.epoch.event gives a list of n=1:79 plus an empty one:</div>
<div><br>
</div>
<div>
<div>ans =</div>
<div><br>
</div>
<div>   Empty matrix: 1-by-0</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>I verified that the same thing happens using the GUI rather than script.</div>
<div><br>
</div>
<div>Does anyone have an idea of what could be going on, and/or is there a better way of getting the epochs I want without epoching twice?</div>
<div><br>
</div>
<div>Many thanks,</div>
<div>Yvonne</div>
<div> </div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<p><br>
</p>
</div>
</body>
</html>