/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv: syntax error
in mosinit2.hoc near line 65
file = new File()
If I move that command to earlier in the file, I get a syntax error pointing to the last line of the hoc file again.
My protocol for populating the vector is contained in a hoc file that is loaded by the mosinit hoc file that I use to run the simulation. This protocol is called interval:
Code: Select all
// create vector for spike times
objref svec
svec = new Vector()
proc interval () { local i, x
low = $1
reps = $3
x = low
dx = $2
for i = 1,reps {
svec.append(x)
x = x + dx
}
}
// create a vector stim that generates events at times in svec
objref vecstim
vecstim = new VecStim()
vecstim.play(svec)
Code: Select all
dt = 0.025
tstop = 10000
v_init = -60
proc init() {
finitialize(-60)
frecord_init()
}
proc integrate() {
while (t<tstop) {
fadvance()
}
}
proc go() {
init()
integrate()
}
proc newvec() {
objref grcspk, nc, nil
grcspk = new Vector()
grc nc = new NetCon(&v(0.5), nil)
nc.threshold = 0
nc.record(grcspk)
}
proc counter() { local firstspk, lastspk, totspk, spkfreq
totspk = grcspk.size
firstspk = grcspk.x[0]
lastspk = grcspk.x[totspk-1]
if (totspk > 1) {
spkfreq = (totspk - 1)/(lastspk - firstspk)
} else{
spkfreq = 0
}
spkcnts.append(spkfreq)
}
proc gocount() { local ii
for ii = 1,2 {
newvec()
interval(3000, ii, 100)
go()
counter()
}
gocount()
counter finds the average spike frequency and appends this to a vector.
gocount launches the simulation.
Neuron does not seem to be happy with this code but it is not giving me error messages that make much sense. How can I run the simulation with iteratively calls so that I can increment my call to the interval procedure?