Find a common element between two matrices of different sizes

8 vues (au cours des 30 derniers jours)
SANGHAMITRA MISHRA
SANGHAMITRA MISHRA le 29 Sep 2017
Réponse apportée : OCDER le 29 Sep 2017
I have two matrices: A=[4, 2, 3, 11, 16, 19, 5, 32] B=[11, 31, 7, 92]
I want to find out the element common in both these vectors. i.e., I want to find the element 11 as my output. How to get this done?

Réponse acceptée

OCDER
OCDER le 29 Sep 2017
Use intersect .
C = intersect(A, B)
C =
11

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 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