%% Continuous time ANN 
 clear; clf; hold on;
 nn = 500; dx=1/nn; C=0; 

%% Training weight matrix
pat=floor(2*rand(nn,10))-0.5;
w=pat*pat'; w=w/w(1,1); w=100*(w-C);
%% Update with localised input 
 tall = []; rall = [];
 I_ext=pat(:,1)+0.5; I_ext(1:10)=1-I_ext(1:10);
 [t,u]=ode45('rnn_ode_u',[0 10],zeros(1,nn),[],nn,dx,w,I_ext);
 r=u>0.; tall=[tall;t]; rall=[rall;r];
%% Update without input 
 I_ext=zeros(nn,1); 
 [t,u]=ode45('rnn_ode_u',[10 20],u(size(u,1),:),[],nn,dx,w,I_ext);
 r=u>0.; tall=[tall;t]; rall=[rall;r];
%% Plotting results
 plot(tall,4*(rall-0.5)*pat/nn)