I am new to matlab and got some intro questions.
If i have a vector A = (1,0,1)
I would like to duplicate each cell 5 times to get
B = (1,1,1,1,1,0,0,0,0,0,1,1,1,1,1)
Which ways are there to do it?
I am new to matlab and got some intro questions.
If i have a vector A = (1,0,1)
I would like to duplicate each cell 5 times to get
B = (1,1,1,1,1,0,0,0,0,0,1,1,1,1,1)
Which ways are there to do it?
One way to do this is to replicate the vector in an additional dimension and then reshape back to the original dimension.
B = reshape(repmat(A,5,1),1,[])