<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
Good afternoon,<br>
<br>
I'm using cfg.offset as an option in ft_redefinetrial, for the purpose of offsetting my t=0 to the response time for each trial. My problem is that after doing this successfully, some of my trials are cut at the ends "randomly" (e.g., instead of being -0.15sec.
 +1.55sec. around the new zero point, some are quite randomly cut to, for instance, -0.01sec. +1.0sec. around the new zero time). I am sure that my original trial length before offsetting is long enough to allow for a -0.15sec. +1.55sec. around the new "offset"
 zero point. So it's not a matter of that. I can't seem to figure out where the problem is though. Here is the code I use:<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
<br>
</div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<i class="elementToProof">r500=[1.249;0.99;0.012;1.003;0.868;0.904;0.761;0.75;0.59;1.034;1.137;1.077;0.46;1.833;0.029;1.167;0.907;1.154;0.926;1.386;0.864;0.898;0.864;0.205;1.203;0.943;0.75;1.035;0.953;0.803;0.849;1.126;0.953;1.169;0.86;0.921;1.079;1.003;0.735;0.798;1.101;0.893;0.857;0.906;0.737;0.876;0.993;0.984;0.968;1.04;0.948;0.925;0.866;1.126;1.278;0.933;0.988;0.814;0.841;0.744;1.289;1.29;1.016;1.333;1.08;0.723;1.207;0.83;0.981;0.949;0.839;1.017;1.061;0.681;0.763;1.012;1.327;1.051;1.137;0.888;1.165;1.077;1.248;0.987;0.841;1.016;1.208;0.914;1.286;1.068;1.451;1.337;0.909;1.536;1.495;1.496;1.033;1.082;1.139;0.895;0.892;1.038;0.739;1.726;1.353;1.259;0.922;1.155;0.926;0.956;1.167;1.233;0.824;0.849;1.048;1.28;1.006;0.929;0.801;0.831;1.1;0.894;1.499;0.903;1.154;1.212;0.839;1.209;1.069;1.124;0.936;0.824;0.923;1.15;1.302;0.907;1.422;1.251;0.791;1.13;1.052;0.893;0.885;0.822;1.328;1.138;1.086;1.573;1.084;0.888;1.295;0.987;0.876;1.441;0.971;1.045;1.524;1.121;1.081;1.133;0.984;0.757;1.307;1.183;1.528;0.942;1.06;1.167;0.887;1.068;1.041;0.842;1.202;1.536;1.156;1.233;1.36;0.944;1.34;0.844;1.013;1.034;0.686;0.897;1.28;1.122;1.105;1.206;1.085;1.037;1.169;0.919;0.844;0.869;1.177;0.836;0.737;0.897;0.692;1.509;1.341;1.387;0.74;1.44;1.149;1.067;0.979;0.951;1.068;1.78;1.033;1.281;1.273;1.63;1.007;1.151;0.819;1.718;1.178;1.116;0.941;1.403;1.142;1.406;0.941;0.866;0.844;1.087;0.951;0.945;1.244;1.04;0.856;1.055;0.945;0.821;1.057]
</i><span style="color: rgb(12, 100, 192);"><i class="elementToProof">%the RTs for one example participant</i></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<i class="elementToProof ContentPasted5">p500=[1;0;1;1;0;1;1;1;1;1;1;0;1;1;1;1;0;0;1;1;1;1;1;1;0;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;0;0;1;0;0;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;1;0;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;1;1;0;0;1;1;1;0;1;1;1;1;0;1;1;1;1;1;1;1;0;1;1;1;0;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;0;0;1;0;1;1;0;1;1;1;1;1;1;1;1;1;0;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;0;1;0;1;1;1;1;0;1;1;1;1;0;1;1;1]
</i><span style="color: rgb(12, 100, 192);"><i class="elementToProof ContentPasted5">%the correct trials for one example participant</i></span><i class="elementToProof ContentPasted5"><br class="ContentPasted5">
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<i class="elementToProof ContentPasted5"><br>
cfg=[];</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<div class="ContentPasted2 elementToProof"><i>cfg.trials=p500 <br>
</i></div>
<i class="elementToProof">data_RT_corr = ft_redefinetrial(cfg, data_RT) </i><span style="color: rgb(12, 100, 192);"><i class="elementToProof">%here I just select the trials that are correct and hence have a response time</i></span><i class="elementToProof"><br>
<br>
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<i class="elementToProof">rts_code = round(r500*500) </i><span style="color: rgb(12, 100, 192);"><i class="elementToProof">%here I transform my RTs from seconds to samples (my sampling rate is 500 Hz)</i></span><i class="elementToProof"><br class="ContentPasted3">
</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1 ContentPasted2 ContentPasted3 ContentPasted4">
<i class="elementToProof">cfg.offset = rts_code <br>
data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr);</i><span style="color: rgb(12, 100, 192);"><i class="elementToProof"> %here is where I offset to the new t=0 for each trial</i></span><i class="elementToProof"><br>
</i>
<div class="ContentPasted4"><i>    </i></div>
<div class="ContentPasted4 elementToProof"><span style="color: rgb(12, 100, 192);"><i>% Now make the epochs until +1.55 sec after the new t=0:</i></span></div>
<div class="ContentPasted4 elementToProof"><i>cfg = [];</i></div>
<div class="ContentPasted4 elementToProof"><i>cfg.toilim = [-0.150 1.550]</i></div>
<div class="ContentPasted4 elementToProof"><i>data_RT_corr_offset = ft_redefinetrial(cfg, data_RT_corr_offset);
</i><span style="color: rgb(12, 100, 192);"><i>%adjust the epoch length </i></span><i><br>
</i></div>
<div class="ContentPasted4"><i>   </i></div>
<div class="ContentPasted4 elementToProof">Any suggestions would be very much appreciated. Thank you!<br>
<br>
Best,<br>
</div>
<br>
Zlati<br>
<br>
</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(0, 0, 0);">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div><span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt">PhD Researcher</span></div>
<span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt"></span>
<div><span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt">School of Psychology</span></div>
<span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt"></span>
<div><span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt">University of Birmingham</span></div>
<div><br>
</div>
<div><span><i><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 9pt; color: rgb(114, 50, 173);">Please note that I am currently working more flexibly, which</span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 9pt; color: rgb(114, 50, 173);">
 may result in sending and </span><span style="color: rgb(114, 50, 173);"><span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt">responding to emails out of hours,</span><span style="font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif; font-size:9pt">
 but </span></span><span style="font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 9pt; color: rgb(114, 50, 173);">there is no expectation on you to do the same.</span></i></span><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>