how to XOR binary matrix

1 回表示 (過去 30 日間)
Jennifer Steven
Jennifer Steven 2017 年 6 月 2 日
コメント済み: Jennifer Steven 2017 年 6 月 3 日
hi ... how to XOR bianry matrix as : [0 1 0 1 1 1 0 0 1 0 1 1] in away that Xoring tow digits together then xor the result with the third bit,,, and do this for the rest of the matrix. And save the result as matrix. starting from right to left.
please help needed.

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 2 日
final_xor_result = mod( sum(YourVector), 2 )
That is, if there are an even number of 1 bits, then the result of the xor is false, and if there are an odd number of 1 bits, then the result of the xor is true. You do not need to do the xor explicitly, just count the bits that are on.
  1 件のコメント
Jennifer Steven
Jennifer Steven 2017 年 6 月 3 日
thanks , it works

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by