So below is the matrix which gives me indexes of data sets defined by dates(represented in column 3, column 1 and column 2 are the first index and last index of that data set).

Matrix_dates_present_indexes =

` 1 1701 1 1702 4955 2 4956 8286 3 8287 11458 4 11459 14740 5 14741 18019 6 18020 21522 7 21523 24994 8 24995 27057 9`

I made the above table so i can grab these indexes and get the represeting values.

what i want to achieve is a extracted matrix based on a user input lets say the user wants data analysis of section 1,2,7,8 only from the whole data set.

index_for_calculation = [1, 2, 7, 8]

then how can u get data into a new matrix with concatenated data saying

new_matrix_want = [1:1701 , 1702:4955 , 18020:21522 ,21523:24994 ]

i hope u understand my question…if not i would like to give more calculation..

thanks

## Best Answer