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

Stephen23
Stephen23 2018년 1월 4일
편집: Stephen23 2018년 1월 4일
"Is there an easy method to do this?"

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2018년 1월 4일
편집: Jan 2018년 1월 4일

1 개 추천

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))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2018년 1월 4일

편집:

2018년 1월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by