MATLAB: Creating a row vector containing values between 1 and 6, each repeated exactly 4 times

combinationspermutationsvector

Is there a way I could generate a row vector (1x 24) that contains the values 1 to 6 repeated exactly 4 times ?

Best Answer

Hello,
You can try this
a = 1:6;
b = repmat(a,1,4)