Hello, I got a problem when dealing with numbers classifying in a vector. Problem is like that:
With a vector A = [1 2 3 4 5 9 10 13 15 17 18 19 21 24];
I try to separate the consecutive series and non-consecutive series so that I am able to have outputs like:
a=[1 2 3 4 5]
b=[9 10]
c=[13]
d=[15]
..etc
I tried diff() and regexp (), but I still can't solve it.
If anyone can help, it would be greatly appreciated.
Thank you!
Best Answer