MATLAB: Delete rows from matrix according to another matrix remove rows from matrix A= 1 2 3; 4 5 6; 7 8 9; 1 3 4; 5 6 7 B= 5 6 7; 1 2 3 A and B are given,how to delete corresponding rows from matrix A according to matrix B? Try not to use loops. Thanks. Best Answer setdiff(A,B,'rows') Related SolutionsMATLAB: Delete rows from matrix Just use some basic MATLAB logical indexing:>> X = M(M(:,1)~=0,:)X = 1 1 2 6 3 5 5 55 6 56 7 69 11 2 MATLAB: Deleting rows in a matrix [x2u, x2u_idx] = unique(x2, 'stable');new_x = x(x2u_idx, :); Related QuestionDelete rows from matrixCovariance MatrixCreating a submatrix from a matrixHow sort rows of matrix as per given index
Best Answer