creating new matrix from remaining of existing 2 matrices

조회 수: 3 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by