Neither A\B
nor pinv(A)*B
help you any, because these commands treat matrix entries as real numbers, not as elements of finite field GF(2).
The command gflineq solves linear systems over the field GP(p) with x = gflineq(A,b,p)
; this command is a part of Communications System Toolbox. If you have the toolbox, then all you need to do is to put the matrix equation AX=B into the form Mx=B by stacking the columns of B, and then reshaping the solution back into matrix form. Like this:
[n, m] = size(A);
b = B(:); % stacked B
M = kron(eye(m), A); % duplicated A to match
sol = gflineq(M, b, 2); % solved Mx=b over GF(2)
X = reshape(sol, m, m); % reshaped into matrix form X
Now, if you don't have the Communications System Toolbox, you'll need to implement solution over GF(2) on your own. The method is standard: Gaussian elimination, and you can find lots of its implementation online. Specifically for binary matrices this algorithm is described in How can I find a solution of binary matrix equation AX = B?