Code:

Code: Select all

```
objref somastim
somastim = new IClamp(0.5)
somastim.del = 0
somastim.dur = 1e9
obfunc createEPSC() {local factor, n, t localobj oneEPSC //$1=rise, $2=decay, $3=amplitude
oneEPSC = new Vector(10001)
factor = (($2/$1)^($2/($1-$2)))*(($2-$1)/$1)
for (n=0; n<10001; n+=1) {
t = n*dt // n = sample number, t = time in ms
oneEPSC.x(n) = ($3)/factor*(exp(-t/$2)-exp(-t/$1))
}
return oneEPSC
}
proc preparePlayVector() {local n, EPSCdel localobj summedEPSC //$1=number of EPSCs, $2=decay
EPSCdel = 1000
summedEPSC = new Vector(tstop/dt)
summedEPSC.copy(createEPSC(.5, 3, 20), EPSCdel/dt)
summedEPSC.play(&somastim.amp, dt) //HERE IS THE PROBLEM!!!
}
preparePlayVector()
```