<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p style="">Hello eeglabbers,<br>
</p>
<p style=""><br>
</p>
<p style="">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 style=""><br>
</p>
<div style="">>> 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 style="">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 style=""><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 style=""><span style="color: rgb(255, 0, 0);">cleanEEG = clean_artifacts(EEG, 'FlatlineCriterion', arg_flatline,...</span><br>
</div>
<p><br>
</p>
<p style=""><br>
</p>
<p style="">I had a good look inside the functions and found this in the fit_eeg_distribution function (inside asr_calibrate):<br>
</p>
<p style=""><br>
</p>
<p style=""><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 style=""><br style="color: rgb(75, 165, 36);">
</p>
<p style=""><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 style=""><br style="color: rgb(75, 165, 36);">
</p>
<p style=""><span style="color: rgb(75, 165, 36);">then in the following line of code:</span><br style="color: rgb(75, 165, 36);">
</p>
<p style=""><br style="color: rgb(75, 165, 36);">
</p>
<p style=""><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 style=""><br style="color: rgb(75, 165, 36);">
</p>
<p style=""><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 style=""><br>
</p>
<p style=""><br>
</p>
<p style="">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 style="">dont know what conclusion to draw.<br>
</p>
<p style=""><br>
</p>
<p style="">Ill run a few more tests, but I just wanted help from the experts :)<br>
</p>
<p style=""><br>
</p>
<p style="">Tyler<br>
</p>
<p style=""><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<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>
</div>
</body>
</html>