multiIntersect

버전 1.0.2 (1.54 KB) 작성자: Iman
this function finds the common elements between all the vector arrays included in the input cell.
다운로드 수: 39
업데이트 날짜: 2018/10/10

라이선스 보기

[commonElements, isCommon] = multiIntersect(x)

this function finds the common elements between all the vector arrays included in the input cell (x).

Each vector array in x has an optional length. The outputs:
1) commonElements includes the common elements between all the vector arrays.
2) isCommon is a cell with the same number of vector arrays as x, each of which has the same length as the corresponding vector array in x and indicates if the element is included in the commonElements or not.

Example)
x = { [11, 1, 19, 2, 11, 4, 6, 7, 9, 11] , [2, 1, 15, 5, 7, 11] , [1, 11, 7, 6, 9, 22] , [1, 7, 11] }
[commonElements, isCommon] = multiIntersect(x)

Answer)
commonElements = [1, 7, 11]
isCommon{1} = [1 1 0 0 1 0 0 1 0 1]
isCommon{2} = [0 1 0 0 1 1]
isCommon{3} = [1 1 1 0 0 0]
isCommon{4} = [1 1 1]

MATLAB 릴리스 호환 정보
개발 환경: R2018b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Arithmetic Operations에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.2

description update!

1.0.1

description update!

1.0.0