% growth function: given some matrix, determines whether a cell's neighbor
%   should die or live.
% for any given entry u in matrix U:
%	u == 3 --> u_iter = 1
%	u > 3 OR u < 2 --> u_iter = -1
%	else u = 0
function U_iter = growth(U)
	K = [1 1 1; 1 0 1; 1 1 1];

	U_iter = conv2(U, K, 'same');
	U_iter = (U_iter == 3) - (U_iter > 3 | U_iter < 2);
end
