I have some problem with saving vector.
I have a Vector called "spktrain" which get values from the code "spktrain.spikebin(vvec, thre)" where vvec is the recorded voltage at soma center and thre is threshold potential.
Each bin of spktrain thus have the value of either 0 or 1. I've check it with sum function that there are 25 spikes.
When I try to save the spike train to a file with this code
Code: Select all
objref fout
fout = new File()
fout.wopen("testspk.txt")
spktrain.printf(fout,"%d\n")
fout.close()
I have try many ways and found that I could successfully export the spike train to a file using the following code
Code: Select all
wopen("f.out")
for i = 0, spktrain.size-1{
fprint("%d\n",spktrain.x(i))
}
wopen()
Using this method is OK for now with one variable, however, it will be bulky in the future if I want to export many vectors.
Note that this is just a single cell.(I'm trying to make a plot of single neuron response function) I found that with network cells, we can use Netcon.record to save variable.(I couldn't find how to use the function with single cell)
Do you have any suggestion to improve the code? I'd really appreciate it.