get a matrix of only zero
1 次查看(过去 30 天)
显示 更早的评论
How can I get a mattrix made of only zeros?
For example I have this matrix
[2 4 0 5 6 0]
I would get a matrix made of only zeros
0 个评论
回答(4 个)
Walter Roberson
2012-11-10
编辑:Walter Roberson
2012-11-10
NewMatrix = 0 .* OldMatrix;
(Mind you, this has a problem if any of the entries were infinite or NaN)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!