[FieldTrip] ft_spikedensity

Santiago Torres, Mr santiago.torres at mail.mcgill.ca
Fri Dec 13 18:06:54 CET 2013

Hello All,
I am trying to run the spike analysis script ft_spikedensity and have the following problem:
When defining the begSample variable in line 234 of the code:

  begSample  = nearest(timeAxis, cfg.latency(1))
Error using nearest
Too many input arguments.

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?

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.

Santiago Torres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131213/864ab3a0/attachment-0001.html>

More information about the fieldtrip mailing list