function p = myand(u)
% MYAND Compute u(1) AND u(2) ... AND u(end), where 1 represents false, and 2 true.
% p = myand(u)

p = 1;
u = u - 1; % convert to 0,1
for i=1:length(u)
  p = and(p, u(i));
end
p = p + 1; % convert to 1,2
