Extract values by matching column values

16 visualizaciones (últimos 30 días)
novice modeler
novice modeler el 10 de Mayo de 2017
Comentada: novice modeler el 11 de Mayo de 2017
Friends, I have two matrices, a and b. a= [ 1 2 3 ; 4 5 6] and b = [1 2 3 4 ; 4 5 6 10]. I want to extract the fourth column of matrix b by matching first three columns of a & b.
Thanks
  2 comentarios
KSSV
KSSV el 11 de Mayo de 2017
Give the out put which you expect.
novice modeler
novice modeler el 11 de Mayo de 2017
4;10

Iniciar sesión para comentar.

Respuestas (1)

Andrei Bobrov
Andrei Bobrov el 11 de Mayo de 2017
[C,ia,ib] = setxor(a',b','rows');
out = C';

Categorías

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