Let $A,B$ be arbitrary matrices with the same number of rows.
How can we find the set of solutions $x,y$ to the matrix equation $Ax=By$?
I understand that this problem is probably related to that of finding a basis for the intersection of two vector spaces, which can be solved as shown in the answers to this question. However, the methods outlined there work when $A,B$ have as columns orthonormal sets, and therefore $\operatorname{Ker}(A)=\operatorname{Ker}(B)=\{0\}$, which needs not be the case here.
How is this kind of equation solved in the general case?