[FieldTrip] ft_realtime_selectiveaverage

Boris Reuderink b.reuderink at donders.ru.nl
Thu Sep 20 11:16:27 CEST 2012


Dear Hamza,

I guess that the function is trying to samples form the FieldTrip buffer form the period before it was started, i.e. samples with negative indices. This might be related to the triggers you have and your trial fun.

Your best bet is to start the MATLAB debugger, and just step through the code until the error occurs. Inspection of variables might give a clue on what is happening.

In the mean-time, I'll try to update the examples with some extra information on how to call these functions.

Best regards,

Boris

--
twitter.com/#!/breuderink | github.com/breuderink | borisreuderink.nl

On 13 sep. 2012, at 11:19, Hamza Fawzi Altakroury (Student) <hamzaf at sabanciuniv.edu> wrote:

> Hello,
> 
> I am tried to run the ft_realtime_selectiveaverage function but I got the following error:
> (note: the error appears after showing a plot with title: condition 255, ntrials = 1.)
> 
> Could you tell me what is the problem.  (exactly what does "connet read data before the begin of the file").
> 
> Best,
> 
> ??? Error using ==> ft_read_data at 243
> cannot read data before the begin of the file
> 
> Error in ==> ft_realtime_selectiveaverage at 94
>     dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', chanindx, 'checkboundary', false);
> 
> Error in ==> online1 at 48
> ft_realtime_selectiveaverage(cfg)
> 
> Statements:
> 
> cfg = [];
> cfg.channel = {'A1'};
> cfg.dataset        = 'buffer://localhost:1972';
> %cfg.trialfun = 'myfun';
> cfg.trialdef.eventtype = 'stimulus';              % By placing '?' we can see the eventtype that we have.
>  cfg.trialdef.eventvalue = 255;
> cfg.trialdef.pre  = 0;
> cfg.trialdef.post = 1.0;
> cfg = ft_definetrial(cfg);
> ft_realtime_selectiveaverage(cfg)
> 
> -- 
> Hamza Fawzi Altakroury
> Graduate student - MA
> Faculty of Engineering and Natural Sciences
> Sabanc─▒ University
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list