Dynamically create vector names
Posted: Mon Apr 19, 2010 4:28 pm
Hello Experts,
I am working on code which records the action potential times for the soma and nodes of the cell model. I am using the APCount for the same. In my cell model, I have single soma and 20 nodes. Below is a part of my code which records the action potential times for the soma.
Since there is only a single soma, the soma_timevector saves the action potential times from the soma. For the nodes, the case is slightly different. Since, there are multiple nodes and the number of action potentials can be different in different nodes, I cannot save the action potential times in a matrix. Below is the code which creates the AP Counter at all nodes.
Is there any way I can dynamically create a variable name, timevector1, timevector2 .... and so on for every iteration?
My final objective is to save these action potential times in a text file. I thought, if I could get the variables with different names, then I could write to a text file.
Thank you,
Sanket Jain
I am working on code which records the action potential times for the soma and nodes of the cell model. I am using the APCount for the same. In my cell model, I have single soma and 20 nodes. Below is a part of my code which records the action potential times for the soma.
Code: Select all
create soma
objref apc_soma //Creating AP Counter in the soma.
access soma
apc_soma=new APCount(.5)
objref soma_timevector
soma_timevector=new Vector()
apc_soma.record(soma_timevector)
Code: Select all
create node[20]
objref apc_nodes[20] // Creating AP Counter at the nodes
objref temp_nodes_timevector
temp_nodes_timevector=new Vector()
for j=0, 19 {
access node[j]
apc_nodes[j]=new APCount(.5)
apc_nodes[j].record(temp_nodes_timevector)
}
My final objective is to save these action potential times in a text file. I thought, if I could get the variables with different names, then I could write to a text file.
Thank you,
Sanket Jain