fork download
  1. B = 1:11;
  2. M = 3;
  3. n = mod(numel(B),2);
  4. B((end-n:-2:end-2*M)) = 0
Success #stdin #stdout 0.17s 65056KB
stdin
Standard input is empty
stdout
B =

    1    2    3    4    5    0    7    0    9    0   11