Exporting rangeVar into .dat file
Posted: Sun Jan 16, 2011 4:54 am
Dear all,
I have two questions relating Rangevar.
1) I want to save the values plotted in the rangevar plot into a data file, using hoc coding. Currently I have this piece of code:
before run() and after defining the cell's morphology and electrophysiology
after run()
At the moment it only saves the values of the first time step. How can I change my code that it records all the time steps (yspacevect with multiple columns with each column one data point)?
2) My second question is how to show the measured rangevar on a space plot defined in the session file, such that if you rerun the simulation you can see from which sections the rangevariable consists.
Thanks for all inputs
I have two questions relating Rangevar.
1) I want to save the values plotted in the rangevar plot into a data file, using hoc coding. Currently I have this piece of code:
before run() and after defining the cell's morphology and electrophysiology
Code: Select all
// Make range variable and put it into vector
objectvar rvp
rvp = new RangeVarPlot("v")
soma rvp.end(1)
apic[79] rvp.begin(1)
//rvp.origin(11.387)
objref yspacevect, disspacevect
yspacevect=new Vector()
disspacevect=new Vector()
rvp.to_vector(yspacevect,disspacevect)
print "yspacevector is ", yspacevect
print "disspacevector is ", disspacevect
Code: Select all
objref savdata2,tempmatrix2
savdata2=new File()
savdata2.wopen("dataspaceplot.dat")
savdata2.printf("distance y\n")
tempmatrix2=new Matrix()
tempmatrix2.resize(disspacevect.size(),2)
tempmatrix2.setcol(0,disspacevect)
tempmatrix2.setcol(1,yspacevect)
tempmatrix2.fprint(savdata2,"%g")
savdata2.close()
2) My second question is how to show the measured rangevar on a space plot defined in the session file, such that if you rerun the simulation you can see from which sections the rangevariable consists.
Thanks for all inputs