creating new matrix from remaining of existing 2 matrices

1 回表示 (過去 30 日間)
SBS
SBS 2020 年 2 月 17 日
コメント済み: SBS 2020 年 2 月 18 日
Hi
i have a big matrix A (34000x9) from which i have created matrix B (3340x9), taking specific rows form matrix A, now the remaining (MatrixA - MatrixB) rows , i want to put in another MatrixC.
Can anybody please help me how to do that?
thanks in advance..really need help.

採用された回答

Rik
Rik 2020 年 2 月 17 日
編集済み: Rik 2020 年 2 月 17 日
Use ismember with the rows switch to find the rows in A that exist in B, flip this logical vector with ~ and use the result to index into A.
L=ismember(A,B,'rows');
C=A(~L,:);
  3 件のコメント
Rik
Rik 2020 年 2 月 17 日
See my edit (untested code).
SBS
SBS 2020 年 2 月 18 日
thank you so much..it worked perfectly.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by