Suppose that we have a 10^6 by 3 matrix A with binary ( 0 or 1) elements. On the other hand, we have a codebook like
codebook =[0,1,1 ; 0,0,1 ; 0,1,0 ; 0,0,0 ; 1,0,0 ; 1,1,0 ; 1,0,1 ; 1,1,1];
I'm looking for a fast code to generate a 10^6 by 1 matrix ( Index ) which shows the corresponding row number for each row according to the codebook . For example if the second row of the A is [1 0 0], the second element of the Index must be 5.
Thanks for your help.
No products are associated with this question.
Play games and win prizes!Learn more