matlab - How can I remove the row of an mx3 matrix from an nx3 matrix (n>m)? -
In the matlab, if there is one mile by 3 matrix which are present in all the large 3 by the matrix, how can I create Am 3 by a matrix (nm) in which there are no rows of the first (m3) matrix?
For example if the first matrix [1 4 6] and the second matrix [1 2 3; 1 4 6; 8 7 4], how can I come up with the matrix: [1 2 3; 8 7 4]?
This is a job for the 'rows' option:
a = [1 4 6]; B = [1 2 3; 1 4 6; 8 7 4]; Eq_rows = ismember (b, a, 'rows'); Results = B (~ eq_rows, :)
Comments
Post a Comment