How to determine number of common elements between two vectors?

14 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 18 de Sept. de 2015
Respondida: Adam el 18 de Sept. de 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.

Respuesta aceptada

Adam
Adam el 18 de Sept. de 2015
numel( intersect( X, Y ) )

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by