필터 지우기
필터 지우기

how to do intersection between 3 vectors?

조회 수: 58 (최근 30일)
Sahar abdalah
Sahar abdalah 2015년 8월 6일
댓글: KAE 2021년 7월 1일
hello, I want to obtain the intersection between 3 vector as fellow :
A = [1,3,8,5];
B = [4,1,6,8];
C= [5,8,7,1];
ABC_inter=intersect(A,B,C,'stable')
the result should be :
ABC_inter=[1,8]
But I obtain this error, please help me to solve this problem and thanks in advance.
Error using intersect (line 101)
Invalid input. Valid flags are 'rows', 'stable', 'sorted', 'legacy', 'R2012a'.
Error in testerr (line 4)
ABC_inter=intersect(A,B,C)
  댓글 수: 1
KAE
KAE 2021년 7월 1일
See this FEX file. including Alexander Stepanov's edit.

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 8월 6일
A = [1,3,8,5];
B = [4,1,6,8];
C= [5,8,7,1];
ABC_inter=intersect(intersect(A,B,'stable'),C,'stable')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by