Changing the properties of cells

The basics of how to develop, test, and use models.
Post Reply
Kim Ha
Posts: 18
Joined: Sun Jun 09, 2013 11:26 pm

Changing the properties of cells

Post 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!
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Changing the properties of cells

Post 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
}
Post Reply