MATLAB: How to divide 3-5 group dataset

dataset

Hello, my project is about sign recognition. My dataset will about 50 images for each 26 alphabet. I want to divide it to be 3 or 5 group. Can you advice me how to do it? Thank you.

Best Answer

Decide the number of elements in each group.
G1 = 10; G2 = 10 ; G3 = 30 ; % three groups
N = 50 ; % 50 images
idx = 1:N ;
C1 = randsample(idx,G1) ; % group 1
idx = setdiff(idx,C1) ;
C2 = randsample(idx,G2) ; % group 2
C3 = setdiff(idx,C2) ;