%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simulation of (leaky) integrate-and-fire neuron
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clf;
% parameters of the model
tau_inv=0.1; % inverse time constant
uu=0; % initial membrane voltage
I_ext=12; % constant external input
tspan=[0 100]; % integration interval
theta=10; % firing threshold
%Integration with Euler method
t_step=0; for it=0:100;
t_step=t_step+1;
x=uu