How do I delete a row from a matrix?

1 回表示 (過去 30 日間)
Nieck Dam
Nieck Dam 2017 年 7 月 2 日
コメント済み: Star Strider 2017 年 7 月 2 日
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, :)
  2 件のコメント
Nieck Dam
Nieck Dam 2017 年 7 月 2 日
Thanks!
Star Strider
Star Strider 2017 年 7 月 2 日
My pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by