Consecutive in what way? Consecutive in value or index location? None of those numbers are consecutive in their values. Why those two that you chose? What criteria are you using to decide upon the second and fifth indexes?
b = a(1 : 2 : end);
b = a(2 : 2 : end);
In general you can give "a" a vector of actual indexes, like [2, 4, 5] (this is called linear indexing) OR you can give a vector of logicals (or doubles that can be evaluated as logicals) that is the same size as the array, like [false, true, false, true, true] or [0, 1, 0, 1, 1].