I have 2 datasets like this
dataset1 (31x1 double):
0
32
45
8
...
91
dataset2 (40x1 double):
5
12
27
10
...
15
I also have dataset1_index (31x1 double) that indexes the values of datset1 from a larger dataset
2
5
6
9
...
58
Similarly, I have dataset2_index (40x1 double) that indexes the values of datset2 from the same larger dataset
3
7
8
13
...
62
I would like to combine dataset1 and dataset2 into dataset3 (71x1 double) but the order of values in dataset3 should follow the order (from small to large) of dataset1_index and dataset2_index. Could anyone help?