So, since my real goal is to find the most frequent combination, and not to merge them, I used this code to finally get it. There probably is an easier way.
clear all
clc
a=zeros(1,7);
x=[25 3 4 3 5 4 4]
y=[7 9 8 9 7 3 7]
z=[x;y]
for i=1:7
for j=1:7
if (z(1,j)==z(1,i))&&(z(2,j)==z(2,i))
a(i)=a(i)+1;
end
end
end
a
maxim=max(a)
[locate]=find(a==maxim)
freq=z(:,locate(1))