Check the matrix result
조회 수: 7 (최근 30일)
이전 댓글 표시
How can i check the entire matrix zero or not
M(sum)=0
댓글 수: 0
채택된 답변
Walter Roberson
2013년 6월 6일
~any(M(:))
will be true if M is entirely 0
I am not sure if your (sum) is intended to convey anything? Are you asking whether the sum over M is 0? If so then,
if ~sum(M(:))
Note, though, that this would be subject to round-off and cancellation problems; there are other techniques to use if you need to be concerned about those.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!