%file oscillate.m
%called by run_oscillate
%exitatory-inhibitory feedback
%with continuous leaky integrator neurons
%linear synapses
function [exit, inhib] = oscillate (inpute, inputi, taue, taui,steps, we, wi)
exit(1)=0; inhib(1)=0;old_ex=0;old_in=0;
for i=2:steps
exit(i)=exp(-1/taue)*old_ex+(1-exp(-1/taue))*(inpute(i)-wi*inhib(i-1));
old_ex = exit(i);
inhib(i)=exp(-1/taui)*old_in+(1-exp(-1/taui))*(inputi(i)+we*exit(i-1));
old_in = inhib(i);
end;
%file run_oscillate.m
%vary weights and time constants to observe different dynamics
t=linspace(1,100);
for (i=1:100)
input(i)=1.0;
end;
%oscillate (input to e, input to i, tau e, tau i, steps, we, wi
%one exitatory and one inhibitory neuron, both leaky integrate continuous
[e,i]=oscillate(1.0*input, 1.0*input, 5, 5, 100, 5.0, 5.0);
figure
plot (t,e);
hold;
plot(t, i, 'r');