<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello All,<br>
I am trying to run the spike analysis script ft_spikedensity and have the following problem:<br>
When defining the begSample variable in line 234 of the code:<br>
<br>
  begSample  = nearest(timeAxis, cfg.latency(1))<br>
Error using nearest<br>
Too many input arguments.<br>
<br>
the code is set such that it inputs two variables to the function nearest, which only allows for one variable as input. This should always give an error independent of the variables that are given to nearest. I tried to do a temporary fix by eliminating the
 second input which seems unnecessary (given that further code uses the values in the timeAxis matrix only) or by making a matrix using cfg.latency(1) as the final value of nearest(timeAxis). Neither of this options work as they give a bigger sampleSel than
 timeAxis (sampleSel(sampleSel>length(timeAxis)) = []). However, I do not want to mess with something that may have other implications further down, and I assume the second variable (cf.latency(1)) is there for a reason. Can someone help explain how to go around
 this problem or why it may not be working?<br>
<br>
timeAxis is a 1*n double matrix with increasing positive time values starting at 0. cfg.latency(1) is 0. I am using a 32-bit matlab version R2012a.<br>
<br>
Thanks,<br>
Santiago Torres<br>
</div>
</body>
</html>