Effacer les filtres
Effacer les filtres

deleting values from an array

2 vues (au cours des 30 derniers jours)
SSG_newbiecoder
SSG_newbiecoder le 4 Jan 2018
Modifié(e) : Stephen23 le 4 Jan 2018
I have an array R3. I need to eliminate those elements of R3 which are present in another, smaller array. Is there an easy method to do this?
  1 commentaire
Stephen23
Stephen23 le 4 Jan 2018
Modifié(e) : Stephen23 le 4 Jan 2018
"Is there an easy method to do this?"

Connectez-vous pour commenter.

Réponse acceptée

Jan
Jan le 4 Jan 2018
Modifié(e) : Jan le 4 Jan 2018
setdiff replies all elements of a vector, which do not appear in a second one:
R3 = setdiff(R3, smallerArray);
Or
R3 = R3(~ismember(R3, smallerArray))

Plus de réponses (0)

Catégories

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