MATLAB: How to add two rows of binary elements of matrix in matlab

binary matrix additionMATLAB

Hello everyone, I want to add the binary matrix rows with the other. For example[1 0 1;1 1 0] i want to add these row and update in the matrix. Thanking you in advance

Best Answer

Ok, you left out a lot of necessary information in your question. In particular, that your addition is performed in the 2 element galois field.
As stated on the wiki page, addition in GF(2) is simply a logical xor, so:
H(1, :) = xor(H(1, :), H(2, :))
Or you could use the features of the Communication System Toolbox (which I don't have) which fully support galois fields computation and has functions for error detection. It may even have your LDPC algorithm already implemented.