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 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