how can I delete the matching rows of two matrices?
이전 댓글 표시
Hello,
If I have a matrix R = [1 2 3; 4 5 6; 7 8 9; 10 11 12] and another matrix C= [ 1 2 3; 4 5 6] I want to create another matrix which is called B. The value of B is the rest of not matching rows between R and C so B should be B[ 7 8 9; 10 11 12]
I made two for loops but it doesn´t work
for i=1:length(R)
for j=1:length(C)
if C(j,3)==R(i,3)
R(i,:)=[]
end
end
end
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!