deleting values from an array

1 Ansicht (letzte 30 Tage)
SSG_newbiecoder
SSG_newbiecoder am 4 Jan. 2018
Bearbeitet: Stephen23 am 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 Kommentar
Stephen23
Stephen23 am 4 Jan. 2018
Bearbeitet: Stephen23 am 4 Jan. 2018
"Is there an easy method to do this?"

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 4 Jan. 2018
Bearbeitet: Jan am 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))

Weitere Antworten (0)

Kategorien

Mehr zu Construct and Work with Object Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by