I have a code that looks like the following:
C = randi([100,200],1000,1000);evenIndices = rem(C,2) == 0allTheEvenNumbers = C(evenIndices)allTheEvenNumbers = allTheEvenNumbers -1locations = find(allTheEvenNumbers)C(locations) = Inf
I am wanting the odd numbers to be replaced by Inf but it is not working. Where am I going wrong?
Best Answer