This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_lif/solution/lifspikes.m
2017-01-23 13:30:51 +01:00

15 lines
275 B
Mathematica

function [spikes, voltage] = lifspikes(V0, E, tau, dt)
voltage = zeros(length(E), 1);
V = V0;
thresh = 1.0;
spikes = [];
for k = 1:length(E)
voltage(k) = V;
if V > thresh
spikes = [spikes; k*dt];
V = 0.0;
end
V = V + (-V+E(k))*dt/tau;
end
end