Hi Julia users,
There are a number of things wrong with this script that I am working on, but for the time being, I am trying to resolve a BoundsError() triggered while slicing an array. Code is attached. The source of the BoundsError() appears to be this function. function spikecounter(Varray) > #spiketimes = Int64[] > Varraycut = splice!(Varray,1:spliceend) > spikecount = 0 > for i in Int64[1:len(Varraycut)] > if Varraycut[i] >= 0 && Varraycut[i-1] < 0 > #= push!(spiketimes,i) > other option of counting spikes is to append spiketimes to an > array, and then count length of array =# > spikecount += 1 > end > end > return spikecount > end > Because of other errors in my code, Varray usually contains NaN entries. However, these NaN entries are still appending into my arrays, and I was thinking that if these entries exist, it should still be possible to splice the array. Do these NaN entries preclude Varray from being spliced? This is the exact error: ERROR: BoundsError() > in getindex at array.jl:246 > in spikecounter at /Users/xieh/Dropbox/spiking/j2test.jl:204 > in moldakarimov at /Users/xieh/Dropbox/spiking/j2test.jl:223 > in calcchi at /Users/xieh/Dropbox/spiking/j2test.jl:306 > in mcmc at /Users/xieh/Dropbox/spiking/j2test.jl:319 > while loading /Users/xieh/Dropbox/spiking/j2test.jl, in expression > starting on line 365 > Thanks, Wally
