<div dir="ltr"><div class="gmail_quote"><br><br><div dir="rtl"><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">Dear community,</p><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">My name is Shiri and I am a student at Tel-Aviv Univesrity. I study perception during sleep using EEG. Currently I am analysing EEG data collected with EGI system.</p><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">I tried using ft_resampledata to detrend the data. The weird thing is that <b>sometimes </b>when I call ft_resampledata, I get an error message:</p><p style="padding:0px;margin:0px 0px 1em" dir="ltr"><span style="font-family:georgia,serif">the input is raw data with 8 channels and 60 trials</span><br><span style="font-family:georgia,serif">resampling data</span><br><span style="font-family:georgia,serif">Octave functions should not run on Matlab</span><br><span style="font-family:georgia,serif">Removing path ... </span><br><font color="#ff0000"><span style="font-family:georgia,serif">Error using .* </span><br><span style="font-family:georgia,serif">Matrix dimensions must agree.</span><br><span style="font-family:georgia,serif">Error in resample (line 71)</span><br><span style="font-family:georgia,serif"> h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ;</span><br><span style="font-family:georgia,serif">Error in ft_resampledata (line 208)</span><br><span style="font-family:georgia,serif"> data.trial{itr} =</span><br><span style="font-family:georgia,serif"> transpose(resample(transpose(data.trial{itr}),fsres,fsorig)); </span><br><br></font><br>As noted, this error appears only sometimes. If I run ft_resampledata again immidiately after receiving the error, it works well (same cfg, same data).<br>The error always happens when I call the function within a parfor loop. It almost never happens when I run the function line individually, without preceeding script lines.</p><p style="padding:0px;margin:0px 0px 1em" dir="ltr"><br>The cfg<span style="color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;font-size:15px;line-height:22.5px"> I use is very basic:</span><br></p><pre style="padding:0.5em;margin-top:0px;margin-bottom:1em;font-size:12px;border:1px dashed rgb(204,204,204);color:rgb(0,0,0);overflow:hidden;font-family:Consolas,'Andale Mono',Menlo,Monaco,monospace;white-space:pre-wrap;width:300px;text-align:justify;background-color:rgb(247,249,250)" dir="ltr"><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;text-align:start;white-space:normal;padding:0px;margin:0px 0px 1em"><font face="georgia, serif">>> display(cfg);</font></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;text-align:start;white-space:normal;padding:0px;margin:0px 0px 1em"><font face="georgia, serif">cfg = </font></p><p style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;text-align:start;white-space:normal;padding:0px;margin:0px 0px 1em"><font face="georgia, serif"> detrend: 'yes'</font></p></pre><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">It happened to me on many data structs, so I share a link with just one of them (<a href="http://www.filedropper.com/dataexample" target="_blank">http://www.filedropper.com/dataexample</a>). Here too, I got the error and right after that I ran the function line again and worked well.</p><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">I don't think it's ok to live in peace with this function erroring from time to time, can someone tell me what this error means? Did I not use the function correctly? </p><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">Best,<br></p><p style="padding:0px;margin:0px 0px 1em;font-size:15px;line-height:22.5px;color:rgb(0,0,0);font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">Shiri</p></div>
</div></div>