Is there a built-in function in Matlab that condenses sequence of half integers to expressions with colon operators?
For example, [1:4,5:.5:7] gives
1, 2, 3, 4, 5, 5.5, 6, 6.5, 7
Given a double array such as [1, 2, 3, 4, 5, 5.5, 6, 6.5, 7], is there a convenient way to convert it back to [1:4,5:.5:7] — or equally valid, [1:5,5.5:.5:7] — as a string?