<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="20" BGCOLOR="#005FA8" BORDERCOLOR="#003E6A" align="center" style="border:1px solid #003E6A;">
<a href="http://www.musc.edu/" target="_blank" style="text-decoration: none;"><FONT FACE="ARIAL" COLOR="#FFFFFF"><span style="color: #ffffff; font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; font-size:13px; text-shadow: 0px -1px 1px #003E6A; white-space:nowrap;">This message was sent securely by MUSC</span></font></a>
</td>
</tr>
</table>

<BR>

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mv="http://macVmlSchemaUri" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Helvetica;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Helvetica">Dear All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica">I am new to Fieldtrip and am trying to compare ERPs between two conditions using the following lines of code. ‘data_iccleaned’ is the processed data structure. The code below is in red and my message
 in black. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg=[];</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.keeptrials = 'yes';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.vartrllength=1;</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.trials = find(data_iccleaned.trialinfo(:,1) == 1);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">erp_pictures = ft_timelockanalysis(cfg, data_iccleaned);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"></span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg=[];</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.keeptrials = 'yes';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.vartrllength=1;</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.trials = find(data_iccleaned.trialinfo(:,1) == 2);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">erp_abstract = ft_timelockanalysis(cfg, data_iccleaned);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">%Baseline Correction</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"></span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg=[];</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfg.baseline = [twin(1) 0];</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">erp_pictures_TL = ft_timelockbaseline(cfg, erp_pictures);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">erp_abstract_TL = ft_timelockbaseline(cfg, erp_abstract);</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"></span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfgp=[];</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfgp.interactive = 'yes';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfgp.layout = 'easycapM11.mat';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfgp.box='yes';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">cfgp.showoutline = 'yes';</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red">ft_multiplotER(cfgp, erp_pictures_TL,erp_abstract_TL.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:black">When I run the last line of code, I get the following error:</span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"><img width="736" height="83" id="Picture_x0020_2" src="cid:image001.png@01D21D6A.13970950"></span><span style="font-family:Courier;color:red"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:red"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Courier;color:black">I believe the problem is that erp_abstract.time and erp_picture.time are of different lengths (please see the picture below). We have sampled the data at 1000 Hz
 and each trial is approx. 8 seconds long (trial lengths vary from 7989 to 8012 points). To circumvent the problem, I tried an additional constraint on the accepted trials (accept only those that are exactly 8000 points) but that did not solve the problem.
 What am I doing wrong? </span><span style="font-family:Courier;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><img width="405" height="621" id="Picture_x0020_1" src="cid:image002.png@01D21D6A.13970950"></span><span style="font-family:Helvetica"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica">            <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman"">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">Tarkeshwar Singh <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">Postdoctoral Scholar<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">Department of Health Sciences and Research<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">Medical University of South Carolina<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">77 President Street, Room C305<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Helvetica">Charleston, SC 29425<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><a href="mailto:hertzfel@musc.edu"><span style="color:#0B4CB4">singht@musc.edu</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Helvetica"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>


<BR>
<BR>
<BR>
-------------------------------------------------------------------------
<BR>
<font face="arial" color="#000000" size="2">This message was secured via TLS by <strong><a
href="http://www.musc.edu"><font color="#0038A8">MUSC</font></a></strong>.</font>