Saving data from 2 parameter runs

Anything that doesn't fit elsewhere.
Post Reply
lb5999
Posts: 56
Joined: Mon Oct 11, 2010 9:12 am

Saving data from 2 parameter runs

Post by lb5999 »

Hi Neuron Community,

I have a question regarding handling large amounts of data.

I have a model cell. I am producing an Injected current - firing frequency (I-F) curve. For each value injected current, I would like the time series for membrane potential, so that I can do further analysis. I therefore have saved the results of my protocol to a matrix, and written it to a datafile.

Trouble is, I want to do this same protocol, for various values of a parameter, GKA.

I have some code that looks like this

Code: Select all

for i=1,nvalues {
GKA=value(i)
for j=1,nstimvalues {
stim.amp=ampvalue(i) // this is the injected current amplitude
// set up vectors recording V, etc.
run()
}
// code for saving data for that value of GKA to a file
}
but how do I "enumerate" the name of the data file, so that at each value of GKA (run of the for loop in i) the simulation data can be written to a new datafile and saved. At the moment, the datafile is just be overwritten with the next run in i

I guess this is equivalent to wanting to save time-series data from the results of a 2dimensional parameter sweep; in GKA and the stimulus amplitude.

Any suggestions would be most appreciated,

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

Re: Saving data from 2 parameter runs

Post by ted »

You'll want to use sprint.

Code: Select all

oc>strdef tstr, fname, basename
oc>basename = "foo"
oc>i = 1
oc>sprint(fname,"%s%d.dat",basename,i)
	1 
oc>fname
foo1.dat
oc>for i=0,3 { \
oc>  sprint(fname,"%s%d.dat",basename,i) \
oc>  print fname \
oc>}
foo0.dat
foo1.dat
foo2.dat
foo3.dat
Post Reply