I have create a axon according to the cable.hoc in the example "http://senselab.med.yale.edu/modeldb/Sh ... \cable.hoc" and my main code is
Code: Select all
objref f, x_model, y_model, z_model
objref neurite
objref tvec,pvec,veclist
load_file("nrngui.hoc")
xopen("D:/home/Model2/my model/SetPara.hoc")
xopen("D:/home/Model2/my model/axon.hoc")
proc GetSL(){
neurite=new SectionList()
forall{
neurite.append()
}
proc InitCell() {
// Extracellular, all parameters are default values
forall insert extracellular
}
proc FindLoca() { local i,n localobj x_comp,y_comp,z_comp
localobj x_sect,y_sect,z_sect,len_sect,range
x_model = new Vector()
y_model = new Vector()
z_model = new Vector()
forsec neurite {
n = n3d()
x_sect = new Vector(n)
y_sect = new Vector(n)
z_sect = new Vector(n)
len_sect = new Vector(n)
for i = 0,n-1 {
x_sect.x[i] = x3d(i)
y_sect.x[i] = y3d(i)
z_sect.x[i] = z3d(i)
len_sect.x[i] = arc3d(i)
}
len_sect.div(len_sect.x[n-1])
range = new Vector(nseg+2)
range.indgen(1/nseg)
range.sub(1/(2*nseg))
range.x[0] = 0
range.x[nseg+1] = 1
x_comp = new Vector(nseg+2)
y_comp = new Vector(nseg+2)
z_comp = new Vector(nseg+2)
x_comp.interpolate(range, len_sect, x_sect)
y_comp.interpolate(range, len_sect, y_sect)
z_comp.interpolate(range, len_sect, z_sect)
x_model.append(x_comp)
y_model.append(y_comp)
z_model.append(z_comp)
}
// Write location information to files
f = new File("D:/NEURON/Model2/my model/coordinate/x_loca1.dat")
f.wopen()
x_model.vwrite(f)
f.close()
f = new File("D:/NEURON/Model2/my model/coordinate/y_loca1.dat")
f.wopen()
y_model.vwrite(f)
f.close()
f = new File("D:/NEURON/Model2/my model/coordinate/z_loca1.dat")
f.wopen()
z_model.vwrite(f)
f.close()
}
proc main(){
GetSL()
InitCell()
FindLoca()
}
main()
quit()
i cant find the problem. do you have any advice?nrniv: syntax error
in /cygdrive/D/home/Model2/my model/main.hoc near line 19
proc FindLoca() { local i,n localobj x_comp,y_comp,z_comp
thanks a lot.