How can I change all numbers in matrix to 1? except for 0
26 次查看(过去 30 天)
显示 更早的评论
How can I change all numbers in matrix to 1? except for 0
I want to make the matrix which has 1(all the numbers) or 0.
0 个评论
采纳的回答
更多回答(2 个)
Walter Roberson
2022-12-3
logical(inputMatrix)
However this will fail if the input includes 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!