comparing two matrix for similar matrix
22 ビュー (過去 30 日間)
古いコメントを表示
So i have matrix A and matrix B and i want to create a matrix C with all the terms that are not alike. What ive tried using is ismember which kinda work.
a = [1 2 3];
b = [1 2 3;
4 5 6;
7 8 9];
i = ismember(b , a);
c = b(~i)
this yields the fallowing result
c = [ 4 ; 7; 5; 8 ; 6 ;9]
but what i need is
c = [4 5 6;
7 8 9]
0 件のコメント
採用された回答
Andrei Bobrov
2017 年 9 月 15 日
編集済み: Andrei Bobrov
2017 年 9 月 15 日
a = [1 2 3];
b = [1 2 3;
4 5 6;
7 8 9];
i = ismember(b , a, 'rows');
c = b(~i,:)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!