I have a matrix of data 60001x4. Rows are data points, columns are the 4 channels recording the data. How would I extract 20 random samples of 1000 data points from each channel? Goal would be to have a 20x1 cell array where each cell is a 1000x4 matrix representing 1 1000-sample segment across the 4 channels. I have done this so far but there must be a better way to do this to make it truly random segments. I simply divided the duration of my signal by 1000 to get how many (num_segments) I would end up with. Then i used randperm to generate 20 random numbers that would correspond to each segment of the 20 out of 60 segments, in this case, that I want.
random_indices = randperm(num_segments,20);