i have two tables ( A 13*52 cell & B 19*75 cell )
A
& B
first column in each(A & B) has a some duplicated numbers ( 4368042 - 4324685 - 4321114 )
i want to found duplicated numbers in first columns and if exist copy all rows of it
to a new table consists of [ A , New B]
New B = only duplicated numbers ( 4368042 - 4324685 - 432111)
i write this code:
clear all; clc
tic
[ndata2 text2 alldata2] = xlsread('datecode.xlsx','devtex');
[ndata text alldata] = xlsread('datecode.xlsx','mdr');
[R1,C1]=size(alldata2);
[R2,C2]=size(alldata);
colsize=max(C1,C2);
for i=1:size(alldata,1)
for j=1:R1
if alldata2{j,1}==alldata{i,1}
data1(j,:)=alldata(i,:);
end
end
end
new_table=[alldata2,data1];
but i got an error in the last line :
CAT arguments dimensions are not consistent.
Error in ==> mdrtry at 37
new_table=[alldata2,data1];
how i can solve this ?