reduce rows of a due to b
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone, I have 2 matices, A and B
a = [0 1 0
0 1 1
1 0 1
1 1 1];
b =[1 1 1
0 1 1];
Is it possible to reduce a using b?
댓글 수: 2
채택된 답변
madhan ravi
2019년 8월 30일
ix = ismember(a,b,'rows');
a(ix,:) % gives you the rows in a which is common to b and ~ix vice versa
댓글 수: 3
추가 답변 (1개)
Jos (10584)
2019년 8월 30일
You can simply use setdiff with the rows option ...
c = setdiff(a,b,'rows')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!