I found the answer and I thought that it might be useful for someone else. The idea is simple. Instead of having two Matrices A and B, write all the information in one matrix. so if you have
A = randn (10,2);
B = randn (10,2);
create a new matrix C and put all the points in that matrix:
C(:,1) = 1: size(A,1);
C(:,2:3) = A;
C(:,4:5) = B;
and simply scatter them separately:
subplot (1,2,1);
scatter (C(:,2), C(:,3));
subplot (1,2,2);
scatter (C(:,4), C(:,5));
linkdata on;
brush on;
There is a slight problem that if you do this, the linkdata pop up window will ask you to connect the XDataSources and YDataSources. You can link them directly on the pop-up window by changing all the A and B vectors to C vectors on the suggested list or you can simply clear A and B after you created the matrix C.
Hope it helps :)