How to get vector from set of ranges?

Sorry actually you don’t even need the array comprehension as reduce accepts a generator, so this will likely be more efficient:

reduce(vcat, i:i+6 for i in indices)
2 Likes