[FieldTrip] 'ft_redefinetrial' returning only one trial

Nakyung Lee rleese12 at berkeley.edu
Thu Jul 28 07:43:44 CEST 2016

Dear FieldTrip community,

I've been having a problem calling 'ft_redefinetrial'.
Basically with my raw data with one trial (simply 'data' here), I've been
trying to segment that one trial into smaller trials (so I can get rid of '
bad_times') by using the following code:

time = data.time{1,1};
bad_times = globals.bad_times_sorted; % a N*2 sorted double

cfg.begsample = [time(1); bad_times(:,2) + 1];
cfg.endsample = [bad_times(:,1) - 1; time(end)];

data_good = ft_redefinetrial(cfg, data);

However the code returns a data with only one trial.
(i.e. the resulting data_good consists of only one trial which correspond
to the time (time(1) : bad_times(1,1).)
The code is very simple and I didn't really expect it to behave this way.
Does anyone see why this is happening?
Any type of help would be appreciated.

Best regards,
Rachel Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160727/b07ef84d/attachment-0001.html>

More information about the fieldtrip mailing list