Extract values by matching column values

21 visualizzazioni (ultimi 30 giorni)
novice modeler
novice modeler il 10 Mag 2017
Commentato: novice modeler il 11 Mag 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

Risposte (1)

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

Categorie

Scopri di più su Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by