<div dir="ltr"><div><span style="font-size:12.8px">Dear FieldTrip community,</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I've been having a problem calling 'ft_redefinetrial'.</span></div><div><span style="font-size:12.8px">Basically with my raw data with one trial (simply '<font color="#000000" face="monospace, monospace">data</font>' here), I've been trying to segment that one trial into smaller trials (so I can get rid of '<font color="#000000" face="monospace, monospace">bad_times</font>') by using the following code:</span></div><div><font color="#000000" face="monospace, monospace"><br></font></div><div><font color="#000000" face="monospace, monospace">time = data.time{1,1};</font></div><div><font color="#000000" face="monospace, monospace">bad_times = globals.bad_times_sorted; </font><font color="#000000" face="monospace, monospace">%</font><span style="color:rgb(0,0,0);font-family:monospace,monospace"> a N*2 sorted double</span></div><div><font color="#000000" face="monospace, monospace"><br></font></div><div><font color="#000000" face="monospace, monospace">cfg.begsample = [time(1); bad_times(:,2) + 1];</font></div><div><font color="#000000" face="monospace, monospace">cfg.endsample = [bad_times(:,1) - 1; time(end)];</font></div><div><font color="#000000" face="monospace, monospace"><br></font></div><div><font color="#000000" face="monospace, monospace">data_good = ft_redefinetrial(cfg, data);</font></div><div><font color="#3d85c6"><br></font></div><div><font color="#000000">However the code returns a data with only one trial.</font></div><div><font color="#000000">(i.e. the resulting data_good consists of only one trial which correspond to the time (<font face="monospace, monospace">time(1) : bad_times(1,1)</font>.)</font></div><div><font color="#000000">The code is very simple and I didn't really expect it to behave this way.</font></div><div><font color="#000000">Does anyone see why this is happening?</font></div><div><font color="#000000">Any type of help would be appreciated.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Best regards,</font></div><div><font color="#000000">Rachel Lee</font></div><div><br></div></div>