MATLAB: How to XOR binary matrix

xor matrix

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.

Best Answer

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.