deleting values from an array

조회 수: 1 (최근 30일)
SSG_newbiecoder
SSG_newbiecoder 2018년 1월 4일
편집: Stephen23 2018년 1월 4일
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일
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개)

카테고리

Help CenterFile Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by