<div dir="rtl"><div dir="ltr">Thank you for your quick reply :)</div><div dir="ltr"><br></div><div dir="ltr">Actually I also need <span style="font-size:12.8px">ft_resampledata</span><span style="font-size:12.8px"> for resampling...</span></div><div dir="ltr"><span style="font-size:12.8px">I get the same problem when trying to sownsample.</span></div><div dir="ltr"><span style="font-size:12.8px"> I refreshed the path settings, do you think it should fix it?</span></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-size:12.8px">Best,</span></div><div dir="ltr"><span style="font-size:12.8px">S.</span></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2016-05-12 12:46 GMT+03:00 Schoffelen, J.M. (Jan Mathijs) <span dir="ltr"><<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">
<div style="word-wrap:break-word">
If your purpose is just to detrend, I would use ft_preprocessing:
<div><br>
</div>
<div>cfg = [];</div>
<div>cfg.detrend = ‘yes’;</div>
<div>data = ft_preprocessing(cfg, data);</div>
<div><br>
</div>
<div>ft_resampledata is for resampling (what’s in a name), and allows for optional detrending prior to the downsampling (because a large trend may lead to edge artifacts upon the downsampling).</div>
<div><br>
</div>
<div>best,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div>PS: I would also recommend to review your path settings, since you get some warnings about octave functions</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<div>
<blockquote type="cite"><div><div class="h5">
<div>On 12 May 2016, at 11:02, shiri makov <<a href="mailto:mkshiri@gmail.com" target="_blank">mkshiri@gmail.com</a>> wrote:</div>
<br>
</div></div><div><div><div class="h5">
<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;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;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;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="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);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;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;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;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;font-family:Calibri,Geneva,Arial,Verdana,sans-serif;text-align:justify" dir="ltr">
Shiri</p>
</div>
</div>
</div></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>