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.
1 个评论
Walter Roberson
2015-9-8
Duplicates http://uk.mathworks.com/matlabcentral/answers/240586-counting-column-bits-with-the-same-weight-in-binary-array which has a posted response
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!