integer to string in NEURON

The basics of how to develop, test, and use models.
Post Reply
tort
Posts: 8
Joined: Thu May 18, 2006 6:16 pm
Location: Boston University

integer to string in NEURON

Post by tort »

Hi,
As I have stochastic parts in my model, I have to run the simulation several times, which I found out could be obtained by say

proc start(){
for(x=0; x<N; x=x+1) {
run()
}
}

Each simulation leads to a .dat file (I changed the run procedure accordingly). So, after N simulation I would like to have N .dat files with the results, however, if I dont change the name of the .dat file I will finish with only one, the last result. Although it is easy to set an integer counter, I didn't find out how to transform it in a string, in order to be used as part of the name of my .dat file.
Ie, I wonder if it is possible to obtain something as (in matlab):

s = ['result' int2str(x)]
save(s,'data','-ascii')

(with, of course, the proper code for NEURON).

Can you help me?

Thank you!

Adriano Tort
ted
Site Admin
Posts: 6393
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

See this thread on the topic
opening data files with variable names
under
Other questions
https://www.neuron.yale.edu/phpBB2/view ... ght=sprint
tort
Posts: 8
Joined: Thu May 18, 2006 6:16 pm
Location: Boston University

Post by tort »

OK, problem solved, thank you very much for your help!
Post Reply