How do I delete a row from a matrix?

1 次查看(过去 30 天)
I have got a matrix with in the 3th column the number 1 or 0. Now I want to delete a row from a matrix when it has got a 0 in the 3th column, so the matrix will only have the number 1 in the 3th column. Can someone help me with this?

采纳的回答

Star Strider
Star Strider 2017-7-2
If ‘M’ os your matrix, this works:
M = M(M(:,3)==1, :)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by