Borrar filtros
Borrar filtros

Setdiff n intersect question

2 visualizaciones (últimos 30 días)
Neesha
Neesha el 21 de Ag. de 2014
Comentada: Neesha el 22 de Ag. de 2014
Hi,
I have two dataset.
1)
  • Shop# - floor#
  • 321 - 4
  • 321 - 2
  • 321 - 3
  • 322 - 0
  • 322 - 2
2)
  • shop# - floor#
  • 322 - 1
  • 322 - 0
  • 322 - 2
if i do intersect of those two, i expect following, but i get just first row. WHy? 3)
  • shop# - floor#
  • 322 - 0
  • 322 - 2

Respuesta aceptada

Guillaume
Guillaume el 21 de Ag. de 2014
>> a=[321 4;321 2;321 3;322 0;322 2];
>> b=[322 1;322 0;322 2];
>> intersect(a, b, 'rows')
ans =
322 0
322 2
  8 comentarios
Matt J
Matt J el 22 de Ag. de 2014
@Neesha, if you got it work, you should accept Guillaume's answer
Neesha
Neesha el 22 de Ag. de 2014
i accepted it, but i did not end up using 'rows', it worked without it as problem was coming from somewhere else

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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