MATLAB: How to replicate matrix

matrix

I have p(x) which has 25 values. I want 640 values in such away that each of p(x)'s are replicated 25 times and the remaining 15(25×25=625) should be added to the last p. I tried this way but not ok
for ii = 1 :length(p);
p2=repmat(p(i) , [1 25]);
end;
thanks for your help.
btw, is there any way of adding the remaining 15 values proportionally.

Best Answer

p=1:25
a=repmat(p,25,1)
out=[a(:);ones(15,1)*p(end)]