I have two matrixes such as
A =
     0     1     1     0
     0     0     1     1
     1     1     1     1
     1     0     1     0
     0     0     0     0
And B is B =
     0     1     1     0
     1     1     1     1
    -1    -1    -1    -1
     1     0     1     0
     0     0     0     0 
My task is how to count the number of different row by row between A and B. For example, the values of second row A and second row B is different, then count increase 1. The values in third row A and third row B are different, then count values is 2 now. Hence, the total different values row by row between A and B is 2. How to implement it by matlab?
Update: Thank Nemesis for the first question. Now I have a other question with matrix A. I want implement the bitxor between rows of matrix A. For simplicity, I use the rem function with 2. The index of rows that xor together are store in index array. This is my code
index=[1 2 4] % row 1,2,4 will xor
output=rem(sum(A(index,:)),2);
The above code works with index size >1. When index size equals 1 that mean the output values is copied from the a row of A. For example, index=[1] then ouput=A(1)=0     1     1     0. My problem is that I cannot apply the above code when index size equals 1. What is happen? Could you edit for me?