randsample() by default is selection without replacement. When you pass in an integer as the first parameter, the implication is to select from 1 to the integer. As you are passing in the same integer as the second parameter, the effect you are going to get is a permutation of the numbers from one to the integer. Since NumberOfClassOneSamples is 2, that is going to be a random permutation of [1 2]... which will give you either [1; 2] or [2; 1] as the answer.
You then try to take the first 6000 entries in that pair of numbers.
In your code each row appears to represent a sample. The number of samples in of data would then be size(ClassOne, 1) not size(ClassOne,2)
Also, classOneTrainingData should be classOne(classOneTrainingIndices, :) because you want all of the entries in the row.