Info

此问题已关闭。 请重新打开它进行编辑或回答。

how to count column bits with the same weight in binary array ?

1 次查看(过去 30 天)
Hi, I have a binary array and I want to count the column with the same weight.
I want to do it with function...m-file For example:
the matrix is (row)X(col) = 7x20:
19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 1 0
Thanks, Henry
There is 6 col with the same weight (two 1 bits) - col=0,3,6,7,11,15. There is 8 col with the same weight (tree 1 bits)- col=1,9,10,12,13,14,17,18. There is 5 col with the same weight (four 1 bits) - col=2,4,5,16,19.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by