I have a sequence of 5000 numbers in a table array of 5000x1. I want to find a way to shuffle with replacement one of every 50 values. for simplicity reasons lets say my sequence is the following: [1 ,2 ,3, 4, 5, 6, ...5000] I would like to randomnly sample with replacement from a subdataset containing the 1st, the 51st, the 101st, the 151st value and so on and then use this value in the 1st position. Then do this for the 2nd value from the subdataset containing the 2nd 52nd 102nd 152nd and so on for every value. It is important that the sampling occurs only from the same dataset and that it is done with replacement. In the end I would like to end up with 1000 new 'random' sequences. I wrote the following code for that:
Where M(:,2) contains my original sequence of interest.
Using this algorithm I am not sure if it works exactly and using the randi function I am not sure the pooling of the data is done randomnly every time.
If anyone has a better alternative please let me know.