How can I replace non positive elements of matrix with a certain number

 Akzeptierte Antwort

max(A,0)
if the replacement is to be 0 for all values less than 0.
Otherwise,
B = A;
B(A<0) = new number
for any other replacement number

Weitere Antworten (0)

Gefragt:

am 16 Mai 2015

Kommentiert:

am 16 Mai 2015

Community Treasure Hunt

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

Start Hunting!

Translated by