i have an array in matlab software like this:
X=[x1,x2,x3];
And, I want to change this array to be like this:
X=[x1,x1,x2,x2,x3,x3];
Is there any command for doing this work in the simplest way ?
i have an array in matlab software like this:
X=[x1,x2,x3];
And, I want to change this array to be like this:
X=[x1,x1,x2,x2,x3,x3];
Is there any command for doing this work in the simplest way ?
Use reshape and repmat like this
a=[1 2 3];reshape(repmat(a, 2, 1), 1, [])
repmat creates the amount of entries and reshape orders it as you asked.