MATLAB: How to generate a matrix whose rows numbers are not elements of a given row vector

MATLABmatrix manipulation

Hi all, pls i want generate a matrix from a matrix A of size m x n whose rows number cannot be an element in a row vector v = [v1 v2 …..vk]. Thanks

Best Answer

The following code should do what you want.
use_row = true(1,size(A,1));
use_row(v) = false;
B = A(use_row,:);