How can I find same arrays in cell of arrays?

1 visualizzazione (ultimi 30 giorni)
Andoni Izaguirre
Andoni Izaguirre il 25 Set 2021
Risposto: David Hill il 25 Set 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?

Risposte (1)

David Hill
David Hill il 25 Set 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

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by