Let’s say I have a binary vector of length N, and I’m looking for the frequency of each of the following 16 sequences in that vector:
0000, 0001, 0010, 0011, ..., 1111
What is the easiest way to count these frequency of each of these sequences in the vector? Ideally, I’d like to know how to do this in MatLab.
Those are the numbers 0x0 to 0xF, just ++ them as indexes into an array of size 0xF. Sum array elements, and A[i]/N is your frequency.