How to determine number of common elements between two vectors?

14 次查看(过去 30 天)
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