Extract values by matching column values

15 vues (au cours des 30 derniers jours)
novice modeler
novice modeler le 10 Mai 2017
Commenté : novice modeler le 11 Mai 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 commentaires
KSSV
KSSV le 11 Mai 2017
Give the out put which you expect.
novice modeler
novice modeler le 11 Mai 2017
4;10

Connectez-vous pour commenter.

Réponses (1)

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

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by