The first part can easily be done as follows: subset = A(1:3:end, :);
To split the data, I can also use the following link http://www.mathworks.com/matlabcentral/answers/47707-how-can-i-randomly-divide-a-dataset-matrix-into-k-parts The last part is very important for me and I am stuck in that part
I made it finally, do you have any other suggestion?
based on this I will randomly generate BB as
bb=[1 3 6];