>> [C,ia,ib] = intersect(A(:,1:2),B(:,1:2),'rows') ;
>> result = [C, A(ia,3), B(ib,3)]
result =
1 10 3 16
1 12 4 15
2 5 10 11
2 6 14 7
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!