You can use logical indexing for that. If m1 is the first matrix and m2 is the second and C is the comparison, I think you want something like:
C = zeros(size(m1));
C(m1>m2) = 1;
C(m2>m1) = -1;
This assumes there are no nans. If that's the case you might initialize C to NaNs and then add a line for the case of m1==m2.