Hello,<br><br>I am tried to run the ft_realtime_selectiveaverage function but I got the following error:<br>(note: the error appears after showing a plot with title: condition 255, ntrials = 1.)<br><br>Could you tell me what is the problem.  (exactly what does "connet read data before the begin of the file").<br>
<br>Best,<br>
<br>??? Error using ==> ft_read_data at 243<br>cannot read data before the begin of the file<br><br>Error in ==> ft_realtime_selectiveaverage at 94<br>    dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', chanindx, 'checkboundary', false);<br>

<br>Error in ==> online1 at 48<br>ft_realtime_selectiveaverage(cfg)<br><br>Statements:<br><br>cfg = [];<br>cfg.channel = {'A1'};<br>cfg.dataset        = 'buffer://localhost:1972';<br>%cfg.trialfun = 'myfun';<br>

cfg.trialdef.eventtype = 'stimulus';              % By placing '?' we can see the eventtype that we have.<br> cfg.trialdef.eventvalue = 255;<br>cfg.trialdef.pre  = 0;<br>cfg.trialdef.post = 1.0;<br>cfg = ft_definetrial(cfg);<br>

ft_realtime_selectiveaverage(cfg)<br clear="all"><br>-- <br>Hamza Fawzi Altakroury<br>Graduate student - MA<br>Faculty of Engineering and Natural Sciences<br>Sabancý University<br>