MATLAB: How to Add Image Classes

image processingMATLAB

I want to classify my image files into 4 classes, but I only get 0 and 1 with this code:
Target_Data = ones(1,Total_Images);
Target_Data(1:Total_Images/4) = 0;
How to add the other classes? Thank you.

Best Answer

Target_Data = repmat((1:4).', Total_Images/4, 1);