MATLAB: Delete matrix row with certain value

row

how can i remove the rows with a certain number say, 2?

Best Answer

M = magic(3);
M(any(M==2,2),:) = []