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일

0 개 추천

If ‘M’ os your matrix, this works:
M = M(M(:,3)==1, :)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2017년 7월 2일

댓글:

2017년 7월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by