MATLAB: Random numbers and storing from 1 -5

for loop

Hi, Trying to create a random number gen from 1-5 and store into an array. I want the random numbers to generate 600 times giving me an 100 random 1's,2's,3's,4's and 5's. I keep getting size issues of left and right, anyone able to help? I should end up with 600 random distributions of 1-5 but it stops on the first loop with "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
Thanks in advance
x=[];
s = 600;
y = [];
for i=1:1:s
y(i)=randperm(5);
y(i) = transpose(y(i));
x = vertcat(x,y(i));
end

Best Answer

I believe this does what you want:
s = 600;
x = zeros(5,s);
for i=1:1:s
x(:,i)=randperm(5)';
end