MATLAB: Comparing two matrices and obtain the un-repeated rows matrices if i have two matrices A and B where B is apart of A ,for example: A=[ 1 2 ; 3 4 ; 5 6 ; 7 8 ; 9 10 ] B=[ 7 8 ; 1 2 ; 9 10 ] i want to compare between them and get matrix C where C = A without B C=[ 3 4 ; 5 6 ] Best Answer A(~ismember(A, B, 'rows'), :) Related SolutionsMATLAB: Comparing two matrix for similar matrix a = [1 2 3];b = [1 2 3; 4 5 6; 7 8 9];i = ismember(b , a, 'rows');c = b(~i,:) MATLAB: A=[6 6;7 8;0 9;9 10] B=[6 6;0 9] how to find Matrix C with rows not in B but in A See ismember() with the 'rows' option. And use logical indexing. Related QuestionHow to find a subset matrix in the main matrix and build a new matrixComparing two matrices for repeated valuesComparing Contents of Two Matrices
Best Answer