How can I find same arrays in cell of arrays?

1 view (last 30 days)
I have created a cell of arrays cell(6,7), where I am saving different arrays of data with 3 colums. The values of the first two colums repeats in different position of the cells and I want to check those values to count how many times and in which cell position are repeated. I am trying to create a loop for check it one by one and count all the combinations.
Someone could help me?

Answers (1)

David Hill
David Hill on 25 Sep 2021
c=1;
for m=1:41
for n=m+1:42
if isequal(A{m}(:,1:2),A{n}(:,1:2))
idx(c,:)=[m,n];%index pairs that have matching first two columns
c=c+1;
end
end
end

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!