Matlab Trick: Counting via Sparse Here is a simple little matlab demo script of how to count items using the command sparse . Counti…