Hi I have a vector filled with sequences of numbers that go up in steps of a value of 1, but there a a couple of these sequences int he vector. ie. [200 201 202 555 556 557 558 923 924 925 926] what is the best (most efficient) way of geting the index's of where the next number does not follow on from the number before it? I could do this by hand using a for loop or something checking the pervious value, but I doubt this is the most efficient way in Matlab. I could loop through it and see that 555 is greater than 202 by a value of more than 1 and so add that index into a new array, or store 202 and 555 in the array, whatever.... but I would expect a vector soemthing like [4 8] which would give me the index of the value where it differed by a value greater than 1. or [202 555 558 923] which gives me the first and last values of the difference sequences. Regards John