<div dir="ltr">Hello,<div><br></div><div>I have been working with continuous data trials which begin before the trigger occurs (ex: [-0.25 1.0] sec) and have run into a snag when using ft_singleplotER.  The error occurs in the raw2timelock subfunction of ft_checkdata after calling ft_singleplotER with a time axis that includes pre-trigger (i.e. < 0) time points.  This error may not be for ft_singleplotER, but it is the function I was trying to use.<br clear="all">

<div><br></div><div style>Here is the error:</div><div style><div>> Subscripted assignment dimension mismatch.</div><div>> </div><div>> Error in ft_checkdata>raw2timelock (line 1753)</div><div>>     tmptrial(i,:,begsmp(i):endsmp(i)) = data.trial{i};</div>

<div>> <br></div><div>> Error in ft_checkdata (line 302)</div><div>>         data = raw2timelock(data);</div><div>> <br></div><div>> Error in ft_singleplotER (line 186)</div><div>>   varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'});</div>

<div><br></div><div style>After some debugging, I found that the number of samples used to (re)generate the time vector is always 1 sample too small if there are negative time values.  I assume that this is because the time point 0 is not being considered (?).  By adding the following line to raw2timelock in ft_checkdata of the most recent build, I was able to get around any errors in this subfunction and all is now copacetic:</div>

</div><div><br></div><div><div>line 1740:    nsmp = nsmp + any(time<0); % <--- acounting for timepoint at 0?</div></div><div><br></div><div style>I don't know if anyone else has run into this problem but I thought I would share this with the community.</div>

<div style><br></div><div style>Regards,</div><div style>Dan</div><div style><br></div>-- <br><div dir="ltr">Daniel Stolzberg, PhD<div>Post-doctoral Fellow</div><div>Cerebral Systems Laboratory</div><div>Department of Physiology and Pharmacology</div>

<div>Schulich School of Medicine & Dentistry</div><div>University of Western Ontario</div><div><a href="http://www.cerebralsystems.ca/" target="_blank">http://www.cerebralsystems.ca/</a><br></div></div>
</div></div>