How can I find same arrays in cell of arrays?

1 回表示 (過去 30 日間)
Andoni Izaguirre
Andoni Izaguirre 2021 年 9 月 25 日
回答済み: David Hill 2021 年 9 月 25 日
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?

回答 (1 件)

David Hill
David Hill 2021 年 9 月 25 日
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

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by