Can IClamp be used in a for loop? Or can it be a vector?
Posted: Wed Apr 13, 2011 7:55 pm
Hi Ted, Thanks for your last reply.
Assume I want to put a sequence of current clamps into a same point of a object, as well as the same amp and dur. The only difference is when (del) I put these inputs. I have tried two methods, for the first one I put stim in a for loop as below
but this program just put the last input into the object, which is when stim.del=500.
Then I tried to make stim as a vector, which looks like below
This time, there is no input at all.
I also tried "while", which gave me the same results.
Could you please tell me why? Thanks a lot!
Assume I want to put a sequence of current clamps into a same point of a object, as well as the same amp and dur. The only difference is when (del) I put these inputs. I have tried two methods, for the first one I put stim in a for loop as below
Code: Select all
objectvar stim
proc do() { local i
for i=0, 9 {
axon stim = new IClamp(0.1)
stim.del = 50*(i+1)
stim.dur = 1
stim.amp = 15
}
}
Then I tried to make stim as a vector, which looks like below
Code: Select all
objectvar stim
stim = new Vector()
proc do() { local i
for i=0, 9 {
axon stim.x[i] = new IClamp(0.1)
stim.x[i].del = 50*(i+1)
stim.x[i].dur = 1
stim.x[i].amp = 15
}
}
I also tried "while", which gave me the same results.
Could you please tell me why? Thanks a lot!