How to determine number of common elements between two vectors?

13 ビュー (過去 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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by