필터 지우기
필터 지우기

How to check for common elements among multiple arrays ? Number of arrays are more than 100 and sizes vary for each array

조회 수: 45 (최근 30일)
result=mintersect(out{1,1},out{1,2},out{1,3},out{1,4},out{1,5},out{1,6},out{1,7},out{1,8},out{1,9},out{1,10},out{1,11},out{1,12},out{1,13},out{1,14},out{1,15},out{1,16},out{1,17},out{1,18},out{1,19},out{1,20},out{1,21},out{1,22},out{1,23},out{1,24},out{1,25},out{1,26},out{1,27},out{1,28},out{1,29},out{1,30},out{1,31},out{1,32},out{1,33},out{1,34},out{1,35},out{1,36},out{1,37},out{1,38},out{1,39},out{1,40})
Is there a better way to do it?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 1월 17일
Use a loop
Com=intersect(out{1,1},out{1,2});
for k=3:size(out,2)
Com=intersect(Com,out(1,k));
if isempty(Com)
break;
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by