delete matrix row with certain value

1 次查看(过去 30 天)
how can i remove the rows with a certain number say, 2?

采纳的回答

the cyclist
the cyclist 2014-11-11
M = magic(3);
M(any(M==2,2),:) = []

更多回答(1 个)

Adam
Adam 2014-11-11
A = [2 3 4 5; 6 7 8 9; 2 1 1 1; 3 3 3 3];
A( any(A == 2, 2 ),: ) = [];

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by