How can I find same arrays in cell of arrays?

1 vue (au cours des 30 derniers jours)
Andoni Izaguirre
Andoni Izaguirre le 25 Sep 2021
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?

Réponses (1)

David Hill
David Hill le 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

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by