<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;">Hi all,</span><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;">I am trying to epoch from 4 seconds before an event up to the event. the code I am using is this:</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;"><p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;">EEG = pop_epoch( EEG, triggers, [0  -4], <span style="color: rgb(178, 69, 243);">'newname'</span>, sprintf(<span style="color: rgb(178, 69, 243);">'epoch_%s'</span>, files(index).name), <span style="color: rgb(178, 69, 243);">'epochinfo'</span>, <span style="color: rgb(178, 69, 243);">'yes'</span>);</p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;"><br></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;">I also tried this:</p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;"><br></p><p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;">EEG = pop_epoch( EEG, triggers, [-4  0], <span style="color: rgb(178, 69, 243);">'newname'</span>, sprintf(<span style="color: rgb(178, 69, 243);">'epoch_%s'</span>, files(index).name), <span style="color: rgb(178, 69, 243);">'epochinfo'</span>, <span style="color: rgb(178, 69, 243);">'yes'</span>);</p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;"></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;">triggers is a cell array: </p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;"><span style="color: rgb(37, 153, 45); font-size: 10px;"><br></span></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Courier; min-height: 14px;"><span style="color: rgb(37, 153, 45); font-size: 10px;">  </span><span style="color: rgb(37, 153, 45); font-size: 10px;">triggers = {'Center_Right_Right' 'Center_Right_Left' 'Center_Left_Right' 'Center_Left_Left'...</span></p><p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);">              'L_Right_Right' 'L_Right_Left' 'R_Right_Right' 'R_Right_Left' 'L_Left_Right'...</p><p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);">              'L_Left_Left' 'R_Left_Right' 'R_Left_Left' 'CenterEmpty_Right'       'CenterEmpty_Left'...</p><p style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(37, 153, 45);">              'RightEmpty_Right' 'RightEmpty_Left' 'Left_Empty_Right' 'Left_Empty_Left'};</p></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;">The algorithm works fine, no errors, however, when I checked the data manually I found that both codes above epoch from event to 4 second after the event and I want to epoch 4 seconds before. What am I doing wrong?</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;">Thank you very much,</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px;">Dritan</div></span><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"></div></div></body></html>