function neighbors = life_neighbors ( board )
%
%  Get the number of rows and columns.
%
  [ m, n ] = size ( board );
%
%  Compute number of neighbors of each cell.
%
  neighbors = zeros ( m, n );
%
%    I-1,J-1    I-1,J      I-1,J+1
%    I,  J-1    I,  J      I,  J+1
%    I+1,J-1    I+1,J      I+1,J+1
%
%  Add neighbors to SOUTH.
%
  neighbors(1:m-1,1:n) = neighbors(1:m-1,1:n)     + board(2:m,1:n);
%
%  Add neighbors to NORTH.
%
  neighbors(2:m,1:n) = neighbors(2:m,1:n)         + board(1:m-1,1:n);
%
%  Add neighbors to EAST.
%
  neighbors(1:m,1:n-1) = neighbors(1:m,1:n-1)     + board(1:m,2:n);
%
%  Add neighbors to WEST.
%
  neighbors(1:m,2:n) = neighbors(1:m,2:n)         + board(1:m,1:n-1);
%
%  Add neighbors to SOUTH-EAST.
%
  neighbors(1:m-1,1:n-1) = neighbors(1:m-1,1:n-1) + board(2:m,2:n);
%
%  Add neighbors to SOUTH-WEST.
%
  neighbors(1:m-1,2:n) = neighbors(1:m-1,2:n)     + board(2:m,1:n-1);
%
%  Add nighbors to NORTH-WEST.
%
  neighbors(2:m,2:n) = neighbors(2:m,2:n)         + board(1:m-1,1:n-1);
%
%  Add neighbors to NORTH-EAST.
%
  neighbors(2:m,1:n-1) = neighbors(2:m,1:n-1)     + board(1:m-1,2:n);

  return
end