added missing m file
This commit is contained in:
parent
f69e99491b
commit
924d00679f
35
projects/project_fano_slope/lifboltzmannspikes.m
Normal file
35
projects/project_fano_slope/lifboltzmannspikes.m
Normal file
@ -0,0 +1,35 @@
|
||||
function spikes = lifboltzmannspikes(trials, input, tmax, gain)
|
||||
% Generate spike times of a leaky integrate-and-fire neuron.
|
||||
% trials: the number of trials to be generated.
|
||||
% input: the stimulus intensity.
|
||||
% tmax: the duration of a trial.
|
||||
% gain: gain of the neuron, i.e. the slope factor of the boltzmann input.
|
||||
|
||||
tau = 0.01;
|
||||
D = 1e-2;
|
||||
imax = 25;
|
||||
ithresh = 10;
|
||||
slope = gain;
|
||||
vreset = 0.0;
|
||||
vthresh = 10.0;
|
||||
dt = 1e-4;
|
||||
|
||||
n = ceil(tmax/dt);
|
||||
inb = imax./(1.0+exp(-slope.*(input - ithresh)));
|
||||
spikes = cell(trials, 1);
|
||||
for k=1:trials
|
||||
times = [];
|
||||
j = 1;
|
||||
v = vreset;
|
||||
noise = sqrt(2.0*D)*randn(n, 1)/sqrt(dt);
|
||||
for i=1:n
|
||||
v = v + (- v + noise(i) + inb)*dt/tau;
|
||||
if v >= vthresh
|
||||
v = vreset;
|
||||
times(j) = i*dt;
|
||||
j = j + 1;
|
||||
end
|
||||
end
|
||||
spikes{k} = times;
|
||||
end
|
||||
end
|
@ -94,7 +94,7 @@ time = [0.0:dt:tmax]; % t_i
|
||||
\part Response of the passive membrane to a step input.
|
||||
|
||||
Set $V_0=0$. Construct a vector for the input $E(t)$ such that
|
||||
$E(t)=0$ for $t<20$\,ms and $t>70$\,ms and $E(t)=10$\,mV for
|
||||
$E(t)=0$ for $t\le 20$\,ms and $t\ge 70$\,ms and $E(t)=10$\,mV for
|
||||
$20$\,ms $<t<70$\,ms. Plot $E(t)$ and the resulting $V(t)$ for
|
||||
$t_{max}=120$\,ms.
|
||||
|
||||
|
Reference in New Issue
Block a user