How can I find elements in sequence in an array?
64 views (last 30 days)
ishita agrawal on 23 May 2017
I have an array of numbers. I want to find set of numbers for which difference of two consecutive numbers is 1. For example, I have a sequence [2,3,6,8,9,10,12,14,16,17]. How can I extract position of (2,3), (8,9,10), (16,17)? I also want to save the output in a new array.