Group data from different matrix that share a column?

Hello everyone.

I have two matrices of size n*2 with the following format: {{x, y},f(x,y)} wich in theory represent the same thing. I want to calculate the mean square error calulating the diference between f1(x,y) and f2(x,y); however, the rows of these two matrices are in different order.
Is there a way for me to alter the order of the rows of one of the matrices so that the first column of both, {x, y} becomes the same?

Any advice is welcome.
Regards.
Jaime.

If the {x, y} are identical in the two matrices then why not sort both of them by their first column?

Very good idea. I have tested it and seems to work fine. Thank you very much.