combine cells with unequal dimensions
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i have two tables ( A 13*52 cell & B 19*75 cell )
A
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147364/image.jpeg)
& B
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147366/image.jpeg)
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 %length(Defs)
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 ?
8 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!