function cycle()
%one step of synchronous updating of whole network

global Nunits nodes synapses

input = synapses*nodes; %vector of node inputs
nodes = sign(input); %new node output activations
nodes(nodes==0) = 1; %arbitrarily set nodes with ties (input=0) to ON

%plot new state of network
figure(1)
for row = 0:(sqrt(Nunits)-1)
   for column = 1:sqrt(Nunits)
      if nodes(row*sqrt(Nunits) + column)==1
         plot(column,sqrt(Nunits)-row,'sr','markerfacecolor','black','markeredgecolor','black')
      else
         plot(column,sqrt(Nunits)-row,'sy','markerfacecolor','yellow','markeredgecolor',[.8 .8 0])
      end
   end
end
