setdiff with reptitions ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
daniel zayed
le 27 Nov 2018
Commenté : Star Strider
le 27 Nov 2018
i have two array A ,B i need to know all elements that inside A but not B including reptitons ,thx .
0 commentaires
Réponse acceptée
Star Strider
le 27 Nov 2018
Modifié(e) : Star Strider
le 27 Nov 2018
Experiment with the ismember (link) funciton or if you are using floating-point numbers, ismembertol (link):
A = randi(9, 1, 10)
B = randi(5, 1, 8)
L = ismember(A, B)
Out = A(L)
or:
Out = A(~L)
depending on the result you want.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!