<div dir="ltr">Dear Tyler and Christian,<div><br></div><div>Thank you for careful investigation and report. I've also recently used the function heavily but the error did not occur, so I need sample data to replicate it (unless Christian 'sees' the problem from your good detailed report). If Christian agrees that we need sample data to replicate the error, would you be able to send it to us?</div><div><br></div><div>Makoto</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 6:38 AM, Tyler Grummett <span dir="ltr"><<a href="mailto:tyler.grummett@flinders.edu.au" target="_blank">tyler.grummett@flinders.edu.au</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 style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello eeglabbers,<br>
</p>
<p><br>
</p>
<p>Recently Ive been using clean_rawdata and it has been working really well. However, I just ran it and it gave me the following error:<br>
</p>
<p><br>
</p>
<div>>> EEG_cleaned = clean_rawdata( EEG, 5, 'off', 0.85, 4, 20, 'off');</div>
<div>Scanning for bad channels...</div>
<div>clean_channel: 1/2, 0.0 minutes remaining.</div>
<div>clean_channel: 2/2, 0.0 minutes remaining.</div>
<div>Removing 3 channel(s)...</div>
<div>Finding a clean section of the data...</div>
<div>Determining time window rejection thresholds...done.</div>
<div>Keeping 14.1% (2 seconds) of the data.</div>
<div>eeg_insertbound(): 4 boundary (break) events added.</div>
<div>eeg_insertbound(): event latencies recomputed and 15 events removed.</div>
<div>eeg_checkset note: upper time limit (xmax) adjusted so (xmax-xmin)*srate+1 = number of frames</div>
<div>Estimating calibration statistics; this may take a while...</div>
<div>Determining per-component thresholds...<span style="color:rgb(255,0,0)">Error using bsxfun</span></div>
<div><span style="color:rgb(255,0,0)">Non-singleton dimensions of the two input arrays must match each other.</span></div>
<div><br style="color:rgb(255,0,0)">
</div>
<div><span style="color:rgb(255,0,0)">Error in asr_calibrate>fit_eeg_distribution (line 377)</span></div>
<div><span style="color:rgb(255,0,0)"> kl = sum(bsxfun(@times,p,bsxfun(@minus,log(p),logq(1:end-1,:)))) + log(m);</span></div>
<div><br style="color:rgb(255,0,0)">
</div>
<div><span style="color:rgb(255,0,0)">Error in asr_calibrate (line 180)</span></div>
<div><span style="color:rgb(255,0,0)"> [mu(c),sig(c)] = fit_eeg_distribution(rms,min_clean_fraction,max_dropout_fraction);</span></div>
<div><br style="color:rgb(255,0,0)">
</div>
<div><span style="color:rgb(255,0,0)">Error in clean_asr (line 164)</span></div>
<div><span style="color:rgb(255,0,0)"> state = asr_calibrate(ref_section.data,ref_section.srate,cutoff);</span></div>
<div><br style="color:rgb(255,0,0)">
</div>
<div><span style="color:rgb(255,0,0)">Error in clean_artifacts (line 219)</span></div>
<div><span style="color:rgb(255,0,0)"> EEG = clean_asr(EEG,burst_crit,[],[],[],burst_crit_refmaxbadchns,burst_crit_reftolerances,[]); end</span></div>
<div><br style="color:rgb(255,0,0)">
</div>
<div><span style="color:rgb(255,0,0)">Error in clean_rawdata (line 83)</span></div>
<div><span style="color:rgb(255,0,0)">cleanEEG = clean_artifacts(EEG, 'FlatlineCriterion', arg_flatline,...</span><br>
</div>
<p><br>
</p>
<p><br>
</p>
<p>I had a good look inside the functions and found this in the fit_eeg_distribution function (inside asr_calibrate):<br>
</p>
<p><br>
</p>
<p><span style="color:rgb(75,165,36)">On line 359 is the following code: X1 = X(1,:); X = bsxfun(@minus,X,X1);</span><br style="color:rgb(75,165,36)">
</p>
<p><br style="color:rgb(75,165,36)">
</p>
<p><span style="color:rgb(75,165,36)">Now i believe that gives a row of 0s.</span><br style="color:rgb(75,165,36)">
</p>
<p><br style="color:rgb(75,165,36)">
</p>
<p><span style="color:rgb(75,165,36)">then in the following line of code:</span><br style="color:rgb(75,165,36)">
</p>
<p><br style="color:rgb(75,165,36)">
</p>
<p><span style="color:rgb(75,165,36)">line 366: H = bsxfun(@times,X(1:m,:),nbins./X(m,:));</span><br style="color:rgb(75,165,36)">
</p>
<p><br style="color:rgb(75,165,36)">
</p>
<p><span style="color:rgb(75,165,36)">H is a line of NaNs, which then crashes the code on line 377.</span><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>I dont know if this is a bug or whether my data is dodgy in some way, but it has worked on other data and so I<br>
</p>
<p>dont know what conclusion to draw.<br>
</p>
<p><br>
</p>
<p>Ill run a few more tests, but I just wanted help from the experts :)<br>
</p><span class="">
<p><br>
</p>
<p>Tyler<br>
</p>
<p><br>
</p>
<div>
<div name="divtagdefaultwrapper">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-size:13px">*************************
<div style="font-family:Tahoma"><br>
</div>
<div><font face="Arial"><i>Tyler Grummett ( BBSc, BSc(Hons I))</i></font></div>
<div><font face="Arial"><i>PhD Candidate</i></font></div>
<div><font face="Arial"><i>Brain Signals Laboratory</i></font></div>
<div><font face="Arial"><i>Flinders University</i></font></div>
<div><font face="Arial"><i>Rm 5A301</i></font></div>
<div><font face="Arial"><i>Ext 66125</i></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</span></div>
</div>
<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><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div>