Check the matrix result
3 次查看(过去 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 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!