[FieldTrip] ft_resampledata error 'Matrix dimensions must agree'

shiri makov mkshiri at gmail.com
Thu May 12 12:13:03 CEST 2016


Thank you for your quick reply :)

Actually I also need ft_resampledata for resampling...
I get the same problem when trying to sownsample.
 I refreshed the path settings, do you think it should fix it?

Best,
S.


2016-05-12 12:46 GMT+03:00 Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl>:

> If your purpose is just to detrend, I would use ft_preprocessing:
>
> cfg = [];
> cfg.detrend = ‘yes’;
> data = ft_preprocessing(cfg, data);
>
> 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).
>
> best,
> Jan-Mathijs
>
> PS: I would also recommend to review your path settings, since you get
> some warnings about octave functions
>
>
>
> On 12 May 2016, at 11:02, shiri makov <mkshiri at gmail.com> wrote:
>
>
>
> Dear community,
>
> 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.
>
> I tried using ft_resampledata to detrend the data. The weird thing is that *
> sometimes *when I call ft_resampledata, I get an error message:
>
> the input is raw data with 8 channels and 60 trials
> resampling data
> Octave functions should not run on Matlab
> Removing path ...
> Error using  .*
> Matrix dimensions must agree.
> Error in resample (line 71)
>       h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,bta)' ;
> Error in ft_resampledata (line 208)
>         data.trial{itr} =
>         transpose(resample(transpose(data.trial{itr}),fsres,fsorig));
>
>
> 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).
> 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.
>
>
> The cfg I use is very basic:
>
> >> display(cfg);
>
> cfg =
>
>     detrend: 'yes'
>
> It happened to me on many data structs, so I share a link with just one of
> them (http://www.filedropper.com/dataexample).  Here too, I got the error
> and right after that I ran the function line again and  worked well.
>
> 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?
>
> Best,
>
> Shiri
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160512/b3e7360c/attachment.html>


More information about the fieldtrip mailing list