how to change matrix element from zero to 1

4 次查看(过去 30 天)
hello i have one matrix 4 by 4 which only it has few zero element how can i say it check the element if less than one then change it to one ?

回答(1 个)

the cyclist
the cyclist 2015-5-17
If A is your matrix,
A(A<1) = 1

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by