<div dir="ltr">Hi Rui,<div><br></div><div>Again thank you for your reply.</div><div>They are samples as well.<br></div><div>Hence the elements of the first row of <font face="monospace, monospace">bad_times</font>, which is 141000, 146000, each represents the 141000th and 146000th indices of time and trial.<br></div><div>And since time is simply and array of consecutive integers (so it acts just like indices) <font face="monospace, monospace">time(end)</font> behaves just like a sample as well.</div><div><br></div><div>Best,</div><div>Rachel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 28, 2016 at 9:19 PM, Rui Li <span dir="ltr"><<a href="mailto:ruil3@student.unimelb.edu.au" target="_blank">ruil3@student.unimelb.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi,<span class=""><div><br></div><div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">cfg.begsample = [time(1); bad_times(:,2) + 1];</font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">cfg.endsample = [bad_times(:,1) - 1; time(end)];</font></div></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace"><br></font></div></span><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">How about the rest three time samples: bad_times(:,2)+1, bad_times(:,1)-1 and time(end)?</font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace"><br></font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">Are they samples or the time?</font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace"><br></font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">Regards,</font></div><div style="font-size:12.8px"><font color="#000000" face="monospace, monospace">Rui.</font></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 29, 2016 at 2:01 AM, Nakyung Lee <span dir="ltr"><<a href="mailto:rleese12@berkeley.edu" target="_blank">rleese12@berkeley.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Rui,<div><br></div><div>In the code, the time (<font face="monospace, monospace">data.time{1,1}</font>) is simply <font face="monospace, monospace">(1:NTime)</font> (so it just increments by 1).</div><div>Would it still matter?</div><div>Thank you for your reply.</div><div><br></div><div>Best,</div><div>Rachel</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 28, 2016 at 12:58 AM, Rui Li <span dir="ltr"><<a href="mailto:ruil3@student.unimelb.edu.au" target="_blank">ruil3@student.unimelb.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, Rachel<div><br></div><div>Probably because cfg.begsample and cfg.endsample should be sample points of the begin and the end of the trails instead of the time;</div><div><br></div><div>I am not sure;</div><div><br></div><div>Regards,</div><div>Rui.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Jul 28, 2016 at 3:43 PM, Nakyung Lee <span dir="ltr"><<a href="mailto:rleese12@berkeley.edu" target="_blank">rleese12@berkeley.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><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>
<br></div></div>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>