MATLAB: How to make a colum of multiple 1 to 5. i want to make column vector of [1;1;1;1;1​;1;1;1;1;1​;1;1;1;1;2​;2;2;2;2;2​;2;2;2;2;2​;2;2;2;3;3​;3;3;3;3;3​;3;3;3;3;3​;3]. is there any way to make this kind of vector instead of typing this many times.

functionmatrixvector

i want to print [1;1;1;1;1;1;1;1;1;1;1;1;1;;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;3;3;3;3;;33;3]. but without typing numbers all the time. how to print 14 times 1, 20 times 2, 50 times 3 in one column vector.

Best Answer

even easier
A=[ones(1,1) 2*ones(1,20) 3*ones(1,50)]'
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG