Borrar filtros
Borrar filtros

deleting values from an array

1 visualización (últimos 30 días)
SSG_newbiecoder
SSG_newbiecoder el 4 de En. de 2018
Editada: Stephen23 el 4 de En. de 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 comentario
Stephen23
Stephen23 el 4 de En. de 2018
Editada: Stephen23 el 4 de En. de 2018
"Is there an easy method to do this?"

Iniciar sesión para comentar.

Respuesta aceptada

Jan
Jan el 4 de En. de 2018
Editada: Jan el 4 de En. de 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))

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by