% AW 12.04.10 % Have fun! function compneuro3a(vv1,vv2,M) % Time evolution of autoassociative networks of 2 neurons % Connectivity Matrices M (=1,2): see lecture (can be switched in % the following) % vv1,vv2; start values for the outputs of the two neurons. % Choose values in the vicinity of the fixed points of the % firing rate equations sytems, to demonstrate the local % stability or instability. % Choose further off the fixed points, to see nonlocal behavior % tend: number of time steps. tend=10; % play with these start values vv1,vv2! %select Matrix with parameter M % connectivity matrix one (with only one attractive fixeed point), % can be switched if M == 1 m11 = 0.5; m12 = 0.5; m21 = 0; m22 = 0.5; else m11 = 2.5; m12 = 2.5; m21 = 0; m22 = 2.5; end; t=0; while (1) t = t+1; v1(t)= vv1; v2(t) = vv2; if (t==3) vv1start = vv1; end; if(t==4) vv2start = vv2; end; vv1 = tanh(m11*v1(t) + m12*v2(t)); vv2 = tanh(m21*v1(t) + m22*v2(t)); sprintf('t=%d: v1(t)= %f, v2(t)=%f',t,v1(t),v2(t)) if (t==tend) break end; end; close all; figure % ,'LineWidth',2,... plot(v1,'LineWidth',2) hold on; plot(v2,'LineWidth',2) %text(pi,0,' \leftarrow sin(\pi)','FontSize',18) xlabel(' time steps','FontSize',18) ylabel('output v1, v2','FontSize',18) text(3.3,vv1start,'v1','FontSize',18) text(4.3,vv2start,'v2','FontSize',18) %set(gca,'XTick',1:1:10,'FontSize',18) % Font Size of Axis Labels set(gca,'FontSize',14) title('Autoassociative Network: firing rates','FontSize',18)