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
Code: Select all
1963 -72.6964 -66.5177 -66.7462
1963.03 -72.6964 -66.5176 -66.7462
1963.05 -72.69
lb5999