counting column bits with the same weight in binary array
古いコメントを表示
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

I hope that someone can help me to solve it.
Thanks Henry
3 件のコメント
dpb
2015 年 9 月 7 日
Attach your data as text, not an image so someone can do something with it, specifically. But, your answers given don't coincide with the data by any stretch...
Henry Buck
2015 年 9 月 8 日
編集済み: dpb
2015 年 9 月 8 日
dpb
2015 年 9 月 8 日
>> [0:size(a,2)-1;sum(a)]
ans =
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
2 3 4 2 4 4 2 2 2 3 3 2 3 3 3 2 4 3 3 4
>>
So, turns out not as far off as thought if you count from the left rather than using the header row as the column number. Other than missing one '2' (col 8), seems ok...
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Multidimensional Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!