So I have this code that check vector x for odd numbers and adds 5 to each of these.
x = [4 5 7 6 5 8 2 1];
x=x+mod(x,2)*5;
disp(x);
How would I modify this to make it work for even numbers?
(Or is there a better way to do the original code to make it more efficient when looking for odd/even numbers?)