Itertools Count Function Matlab Code