MATLAB: How to replace non positive elements of matrix with a certain number

replacing elements of matrix

For example A=[7 4 2 1 -0.2 -3]
I want to get [7 4 2 0 0 ]

Best Answer

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