isOdd = logical(mod(N,2)); isEven = ~logical(mod(N,2));