There is an example in the Programmer's Reference documentation of the Vector class's record() method. Go to
http://www.neuron.yale.edu, click on Programmer's Reference, then select "Quick Index" and click on Vector.
If your cells are instances of object classes, their sections should be accessible from hoc by this syntax
cellname.sectionname
So if you had an objref called pyr that pointed to an instance of a cell class (that is, your network setup code contained statements something like these
Code: Select all
objref pyr
pyr = new SomeCellClass()
) then to record the membrane potential of pyr.soma you would use statements like this:
Code: Select all
// execute these statements _after_ the network has been set up
// only need to do this once--a new recording will be generated on each run
objref vvec
vvec = new Vector()
vvec.record(&pyr.soma.v(0.5))
You'll probably also want to record time to a vector
Code: Select all
objref tvec
tvec = new Vector()
tvec.record(&t)
After you get it working with just one voltage and one time vector, you'll want to record voltage time course from many cells. For this it is best to use a List to manage all of your Vectors. Assuming that each cell in your network has been appended to a List, you can iterate over each cell in the list of cells, creating a Vector to capture the time course of its somatic v, executing a Vector record() statement, and finally appending the Vector to the List of Vectors. Your program will be organized like this (writing in pseudocode):
Code: Select all
read parameters from the textfile that Matlab wrote
specify properties of cell classes
create instances of cell classes (and append them to a List of cells)
connect the cells (and append the NetCons to a List of connections)
// at this point the network has been created
// now set up recording
create a Vector called tvec and use the record() method to make it capture t
for each element in the List of cells {
create a new Vector and use the record() method to make it capture this cell's soma.v(0.5)
append the Vector to the list of recording Vectors
}
run a simulation
open a new output file
write tvec to the output file
for each element in the list of recording Vectors {
write this vector to the output file
}
close the output file