I have 2 matrices of different size. Matrix A is 1000x18, while B has 950x10 size. The values in columns 2,3 and 4 can be common for both data sets. My goal is to merge them into single matrix consisting of shared values from columns 2:4 and corresponding to them values from column 5 in A and columns 6 and 8 from B. I tried to use this code, but it fails in generating combined matrix C:
[j] = intersect(out1(:,2:4),out2(:,2:4),'rows');
C = [out2(j,5) out1(j,[6 8])];
I would appreciate any help.