how to XOR binary matrix
1 view (last 30 days)
Show older comments
Jennifer Steven
on 2 Jun 2017
Commented: Jennifer Steven
on 3 Jun 2017
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.
0 Comments
Accepted Answer
Walter Roberson
on 2 Jun 2017
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.
More Answers (0)
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!