This is probably simple but here is my problem.
I have two vectors, starts and ends. Starts are the starting points of sequences of consecutive numbers and ends are the end points of sequences of consecutive numbers. I would like to create a vector which contains these runs.
So for example, say
starts = [2 7 10 18 24]
ends = [5 8 15 20 30]
I would like to create the following vector
ans = [2 3 4 5 7 8 10 11 12 13 14 15 18 19 20 24 25 26 27 28 29 30]
Using starts:end only uses the first element of each vector
I would also like to do this without using a (for) loop in order to keep it as fast as possible!
Thanks for reading
Chris