Extract values by matching column values

15 ビュー (過去 30 日間)
novice modeler
novice modeler 2017 年 5 月 10 日
コメント済み: novice modeler 2017 年 5 月 11 日
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 件のコメント
KSSV
KSSV 2017 年 5 月 11 日
Give the out put which you expect.
novice modeler
novice modeler 2017 年 5 月 11 日
4;10

サインインしてコメントする。

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2017 年 5 月 11 日
[C,ia,ib] = setxor(a',b','rows');
out = C';

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by