I've used this code to separate data to test and train .for example i have a dataset include of 6 image. when i run this code, training data is correct and have 3 image but testing data is like this image :(The third image is repeated again).
I can't understand what is the problem .
Please help me
idx = 1:numImageFiles ;
PTrain = 0.50 ;
Ptest = 0.50;
train_idx = baseFileNames(1:round(PTrain*numImageFiles));
test_idx = baseFileNames(round(Ptest*numImageFiles):end,:) ;