필터 지우기
필터 지우기

delete matrix row with certain value

조회 수: 1 (최근 30일)
Patrick
Patrick 2014년 11월 11일
댓글: Patrick 2014년 11월 11일
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에서 Data Import and Network Parameters에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by