how do I record a single cell of a matrix with python?
I know that if I want to record a Vector I can use the following code:
Code: Select all
Vvec = h.Vector()
Vvec.record(y0._ref_x[0])
Code: Select all
Vvec = h.Vector()
Vvec.record(c._ref_x[0][0])
Moderator: hines
Code: Select all
Vvec = h.Vector()
Vvec.record(y0._ref_x[0])
Code: Select all
Vvec = h.Vector()
Vvec.record(c._ref_x[0][0])
I'm not sure what you're asking. A matrix is an array of numbers. A model cell is not a number, so the phrase "a single cell of a matrix" has no meaning. Also, a cell is not a variable that changes with time, so what could it mean to "record" a cell? Are you saying that you created a bunch of cells that you are managing with array notation? That is, the name of any particular cell will be of the formoren wrote:how do I record a single cell of a matrix with python?
Close, but not quite right. Given a section called dend, the membrane potential at the 0.3 location of dend is called dend(0.3).v, and the way to record this voltage to a vector called Vvec isI know that if I want to record a Vector I can use the following code:Code: Select all
Vvec = h.Vector() Vvec.record(y0._ref_x[0])
Code: Select all
...
nlm = h.LinearMechanism(callback, cmat, gmat, y, y0, b)
dummy = h.Section()
trajec = h.Vector()
tvec = h.Vector()
trajec.record(y._ref_x[0]) // here we record the values in the vector y
tvec.record(h._ref_t)
...
Code: Select all
trajec.record(cmat._ref_x[0][0])
Code: Select all
h('''
proc matrix_element_record() {
$o1.record(&$o2.x[$3][$4])
}
''')
m = h.Matrix(3,3)
v = h.Vector()
h.matrix_element_record(v, m, 1, 2)