% scan.m % updates u using scan algorithm % % omega = inhibition constant % inVector = initial state % n = number of iterations function u = scan (omega, inVector, n) W=iweight(omega); u=inVector; t=1; while t <= n i=1; while i <= 9 j=1; thesum = 0; while j <= 9 thesum = thesum + W(i,j)*u(j); j = j+1; end if (thesum > 0) u(i) = 1; else u(i) = 0; end i = i+1; end u t = t+1; end