Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Remove repeated row in a matrix (specially zero's repeated row)
조회 수: 1 (최근 30일)
이전 댓글 표시
a =
1 4 6
0 0 0
6 7 3
0 0 0
3 1 2
0 0 0
0 0 0
Remove the repeated zero row.
I want this output
b=
1 4 6
0 0 0
6 7 3
3 1 2
답변 (1개)
Azzi Abdelmalek
2013년 11월 4일
편집: Azzi Abdelmalek
2013년 11월 5일
EDIT
a = [1 4 6
0 0 0
6 7 3
0 0 0
3 1 2
0 0 0
0 0 0]
idx=find(~any(a,2))
a(idx(2:end),:)=[]
댓글 수: 4
Azzi Abdelmalek
2013년 11월 5일
편집: Azzi Abdelmalek
2013년 11월 5일
Ok, try this
idx=find(~any(a,2))
a(idx(2:end),:)=[]
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!