Help saving section currents
Posted: Fri Jun 06, 2014 2:01 am
Hi everyone. I'm a new user of NEURON and have gotten pretty far just hacking other people's code. But I'm stuck at trying to save individual segment currents to a file. I've gotten as far as shown below. I can generate current output but all the currents in a segment come out to be the same.
So this code:
Gives this output which is just the same currents for each segment in section:
I'm sure there's a simple correction, but I can't figure it out. I'm not even sure if "i_membrane" and "area" are intrinsic variables or the person whose code I'm using has generated these values. Help please!
Hoc syntax is driving me bananas!
Thanks in advance for any help.
Cat
So this code:
Code: Select all
j = 0
forall {
for i=1, n3d()-1 { //COSTAS: Need to start from ZERO; Not sure... i_membrane doesn't start at 0
j = j + 1 // global segment index
//Use indexes which chop up the segment into appropriate fractions; e.g. 1/8, 3/8, 5/8, 7/8
i_segment.x[j] = i_membrane(((i-1)*2+1)/(2*(n3d()-1)))*area(((i-1)*2+1)/(2*(n3d()-1)))
fprint("%f\n", i_segment.x[j]) //current segment saved
}
}
wopen()
Code: Select all
...
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.018351
0.001033
0.001033
0.001033
0.001033
0.000085
0.000085
0.000085
0.000085
0.000085
0.000005
0.000005
0.000005
0.000005
...
Hoc syntax is driving me bananas!
Thanks in advance for any help.
Cat