MATLAB: Add or subtraction a unit to matrix even elements in matlab

add or subtraction a unit to matrix even elements

For example, I want to add two units to the even matrix elements and show the new matrix
r=[1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16];
Thanks for your help

Best Answer

Friends help and I found
r=[2 6 10 16; 3 7 11 19; 4 8 12 18; 5 9 14 20]
z = r;
z(:,2:2:end) = z(:,2:2:end)+2