MATLAB: Expand matrix pattern by rows only

MATLABmatrixmatrix manipulation

I want to expand the following pattern 365 times. Have tried the repmat command, however this will produce 365 columns as well which is too big for matlab to handle.
So the end result i want is a matrix of size 86400*365,1
A = 0:28800;
B = 28801:43200;
C = 43201:46800;
D = 46801:61200;
E = 61201:86400;
x = [zeros(28800,1); 400*ones(length(B),1); zeros(length(C),1); 400*ones(length(D),1); zeros(length(E),1)];

Best Answer

You can give multiple dimensions to repmat:
repmat(x,1,365)