MATLAB: If i want to change each value 1 in a matrix to 0 how to do that

matlab function

a=[1 2 3;1 3 3;2 1 2]
is there a function that make a as below
b=[0 2 3;0 3 3;2 0 2]

Best Answer

b = a;
b(b==1) = 0;