setdiff with reptitions ?

2 visualizaciones (últimos 30 días)
daniel zayed
daniel zayed el 27 de Nov. de 2018
Comentada: Star Strider el 27 de Nov. de 2018
i have two array A ,B i need to know all elements that inside A but not B including reptitons ,thx .

Respuesta aceptada

Star Strider
Star Strider el 27 de Nov. de 2018
Editada: Star Strider el 27 de Nov. de 2018
Experiment with the ismember (link) funciton or if you are using floating-point numbers, ismembertol (link):
A = randi(9, 1, 10)
B = randi(5, 1, 8)
L = ismember(A, B)
Out = A(L)
or:
Out = A(~L)
depending on the result you want.
  2 comentarios
daniel zayed
daniel zayed el 27 de Nov. de 2018
thx :)
Star Strider
Star Strider el 27 de Nov. de 2018
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by