필터 지우기
필터 지우기

matching numbers between variables

조회 수: 10 (최근 30일)
George Head
George Head 2019년 12월 17일
답변: Ridwan Alam 2019년 12월 17일
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.

채택된 답변

Ridwan Alam
Ridwan Alam 2019년 12월 17일
GroupZERO(ismember(GroupZERO,outliers))=[]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by