I would like to know whats a juliatic way of indexing or slicing evenly 
spaced ranges out of an array:

If I want to take out every n:th element out of Julia array, I would do 
something like

a = [1,2,3,4,5,6];
everySecond = a[2:2:end];

What I would like to achieve is a slice of specified size between evenly 
spaced step sizes. So after n length step, collect a slice of specified 
length. 
So if I have step size as 1 and then I want to take the next two elements I 
would expect the result to be:

a = [1,2,3,4,5,6,7,8,9,10];

magicIndexing(a)
>[2,3,5,6,8,9]

Is there a nice way of achieving something like this?

Reply via email to