Page 1 of 1

Plotting vectors?

Posted: Wed Nov 02, 2005 3:51 pm
by ferron
Hello, I'm using the e_extracellular as a "voltage source" for an extracellular electrode. I have a file which contains in the first column the "time" variable of my applied potential and the "M" other columns contains the voltages at each and every "z" of my axon.

objref field, potentialsfile
potentialsfile = new File("potentialsmatrix.txt")
potentialsfile.ropen()
field = new Matrix()
objref vex[stimnum], tvec
tvec = field.getcol(0) // reading the first column into tvec

for ii=0, stimnum-1{ // reading the other columns into vector "vex[]"
vex[ii] = field.getcol(ii+1)
}

objref field // free up space

I would like to obtain a graphical view of those two vectors... I mean
vex[] plotted in function of tvec... But I don't know how. I've tried to plot e_extracellular(0.5) on the same graphic as the node.v(0.5) but I get very strange things...

Thanks

update

Posted: Wed Nov 02, 2005 5:20 pm
by ferron
Ok, I found how to plot the vector with the vec.plot function...

Which indeed brought up another question concerning the third arguments of the vec.play function "continuous"

Is it possible that the "When continuous is 1 then linear interpolation is used to define the values between time points." in the manual should be change to "By default, continuous is 1 and linear interpolation...."

Is it possible to stop the linear interpolation? I would like that the values passed to the play function remain stable untill the next value is given from the tvec?

Thanks

Posted: Thu Nov 03, 2005 6:51 am
by hines
Unless the third arg of Vector.play is 1 or
the third arg is a Vector of discontinuity indices
of the second arg, the Vector being played is
considered to be a step function.

Posted: Thu Nov 03, 2005 10:01 am
by ferron
Well, the vector tvec is compose of time steps
0,5
1
1,5
2
2,5
...

And the vex[] comprise voltages values which I want to be applied at the time specified by tvec
10
0
10
0
10
...

I tought I would create a step stimulus with value 10 from 0,5 to 1 and then value 0 from 1 to 1,5, etc.

Instead I get a toothsaw stimulus... that's why I tought I was getting interpolation between the time steps.

Thanks

Posted: Thu Nov 03, 2005 7:49 pm
by ted
Well, the vector tvec is compose of time steps
0,5
1
Is there an explanation on the WWW of why numbers with a fractional part are
written with , in some countries and . in others?
Instead I get a toothsaw stimulus... that's why I tought I was getting interpolation between the time steps.
Are you using fixed dt or adaptive integration? If fixed dt, what is the time step?