Effacer les filtres
Effacer les filtres

matching numbers between variables

10 vues (au cours des 30 derniers jours)
George Head
George Head le 17 Déc 2019
i have two matrices, both containing lists of numbers.
outliers = [14, 32, 38, 44.....]
GroupZERO = [1, 2, 3, 14, 15, 16...]
im trying to make it so that if any value in GroupZERO = any value in outliers then remove it from GroupZERO, so in this instance 14 would be deleted out of GroupZERO and if for example 44 were in Groupzero, that would be removed as well etc.
this was the code i trired:
outlier = find(GroupZERO(1,:)==outliers)
GroupZERO(:,outlier) = []
... however it is saying matrix dimensions do not agree.
Thanks.

Réponse acceptée

Ridwan Alam
Ridwan Alam le 17 Déc 2019
GroupZERO(ismember(GroupZERO,outliers))=[]

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by