% async.m % updates u asynchronously % % omega = inhibition constant % inVector = initial state % n = number of iterations function u = async (omega, inVector, n) W=iweight(omega); u=inVector; t=1; while t <= n i = ceil(9*rand); 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 t = t+1; u% end