Matrix of recorded vectors error; matrix .dat file truncated

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

Matrix of recorded vectors error; matrix .dat file truncated

Post by lb5999 »

Hi NEURON Forum,

I have a matrix, which has first column which is the timestep, and last 3 columns which consist of the recordings from a simulation from 3 different sections of my cell. When I write the matrix to a data file, and open the .dat datafile for viewing (and opening in MATLAB), it truncates the columns and rows of the matrix (seemingly at random). However, when I run some checks in the hoc command prompt by using .x[nrow][ncol], I see that the matrix has the correct full size. Moreover, when I pick the vectors for the simulation, and save them to a datafile, opening these 3 seperate .dat files results in data files of the correct length. Code below. I have no idea why the matrix isn't displaying the full data for the simulations! Any pointers would be most appreciated :)

Code: Select all

oc>objectvar M, Data
oc>M = new Matrix()
oc>Data = new File()
oc>M.resize(dv[0].size(),4) // dv[0] one of 3 recorded vectors.
        Matrix[0] 
oc>ndv           
        3 
oc>for i=0, ndv-1 M.setcol(i+1,dv[i])  // Have 3 recording vectors from simulation - dv[0],dv[1],dv[2]. First column of matrix will be time.
oc>dv[1].x[5000]
        -66.024516 
oc>M.x[5000][2]
        -66.024516 
oc>dv[0].size()
        80001 
oc>M.x[80000][3] 
        -66.711785 
oc>dv[2].x[80000]
        -66.711785 
oc>objectvar vdt
oc>vdt = new Vector()
oc>vdt.resize(dv[0].size()) // Time column created by creating an indgen vector vdt with stepsize=dt.
        Vector[53] 
oc>dt       
        0.025 
oc>vdt.indgen(dt)
        Vector[53] 
oc>M.setcol(0,vdt)
        Matrix[0] 
oc>M.x[80000][0]
        2000 
oc>vdt.x[80000]
        2000 
oc>Data.wopen("Sim1.dat")
        1 
oc>M.fprint(Data, " %g")
        0 
And here is a paste of the last 3 rows of Sim1.dat - the datafile created by the above process. Note how both the rows are columns are truncate above the desired size of the matrix.

Code: Select all

 
1963 -72.6964 -66.5177 -66.7462
1963.03 -72.6964 -66.5176 -66.7462
1963.05 -72.69
Thanks,

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

Re: Matrix of recorded vectors error; matrix .dat file truncated

Post by ted »

Does this occur if the data vectors are 10 elements long? 100? 1000? Does your code contain a statement that closes the file? What OS are you using and which version of NEURON?
Post Reply