Page 1 of 1
Changing the properties of cells
Posted: Mon Jul 22, 2013 7:22 pm
by Kim Ha
Hi Ted,
To change Ra of all cells in my model, I excute the following code:
Code: Select all
for i=0, cells.count()-1 {
Ra = 100
}
However the spike train does not change (note that when I open the hoc file by txt, change the value there and save, the spike train changes). Can you show me my problem? To change the properties of cells such as L, diam, and so on, can I make the for loop like this way?
Thank you!
Re: Changing the properties of cells
Posted: Tue Jul 23, 2013 10:16 am
by ted
The loop does not tell hoc that this statement
Ra = 100
is supposed to be executed for each section in each cell. Consequently hoc merely sets Ra to 100 in the "default" section again and again. The default section is the section whose name can be discovered by executing
print secname()
at the oc> prompt.
If the follwing assumptions are true
1. each element in the cells List is an objref that points to an instance of a biophysical model cell class
2. each biophysical model class has a public member called "all," where "all" is a SectionList that contains all of the sections of that model cell
then here's what you need to do (in pseudocode):
Code: Select all
for each cell in the cells List {
for each section in this particular cell {
Ra = 100
}
}
One way to express this in hoc is
Code: Select all
for i=0,cells.count()-1 {
forsec cells.o(i).all Ra=100
}