How to determine number of common elements between two vectors?

조회 수: 14 (최근 30일)
Mr M.
Mr M. 2015년 9월 18일
답변: Adam 2015년 9월 18일
for example X = 1:10 Y = [5,7,13,25,45,56] So 5 and 7 are the common elements, and the answer should be 2.

채택된 답변

Adam
Adam 2015년 9월 18일
numel( intersect( X, Y ) )

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by