function z = bsxmod(x, y) % bsxmod(x, y) = bsxfun(@mod, x, y); % Binary "Modulus after division" operator applied element-wise to x and y. % Singleton dimensions are implicitly expanded to make x and y match in size. z = bsxfun(@mod, x, y);