How can I find same arrays in cell of arrays?

1 visualización (últimos 30 días)
Andoni Izaguirre
Andoni Izaguirre el 25 de Sept. de 2021
Respondida: David Hill el 25 de Sept. de 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?

Respuestas (1)

David Hill
David Hill el 25 de Sept. de 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

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by