delete row in matrix if the row contain "Inf" value
조회 수: 8 (최근 30일)
이전 댓글 표시
Let's say:
A=[1 2 3 5
2 Inf Inf Inf ---->delete this row
3 1 7 5
9 Inf Inf Inf ---->delete this row
11 3 45 91 ]
Question: If i want to delete the row contain "Inf", how can I do that?
result_A=[1 2 3 5
3 1 7 5
11 3 45 91 ]
댓글 수: 0
채택된 답변
추가 답변 (2개)
LU Chongkai
2020년 4월 12일
Here is a way that don't change the original matrix:
B = A(any(~isinf(A),2),:)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!