How to determine number of common elements between two vectors?

13 vues (au cours des 30 derniers jours)
Mr M.
Mr M. le 18 Sep 2015
Réponse apportée : Adam le 18 Sep 2015
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.

Réponse acceptée

Adam
Adam le 18 Sep 2015
numel( intersect( X, Y ) )

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by