Hello everyone,
I have one matrix "A" with dimension 358×1 and I am trying to form a new matrix "B" with dimension 520×1. I need to form the matrix "B" using with the values of "A" where every five values I would like the fifth to be duplicated and attached to itself two times.
More easily, supposing a matrix "XY" with dimension 15×1, I would like to duplicate the rows 5, 10 and 15 two times and then attach that values to themselves. At the end, I should have a new matrix "XYZ" with dimension 21×1. Practically:
XY = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15]
XYZ = [1; 2; 3; 4; 5; 5; 5; 6; 7; 8; 9; 10; 10; 10; 11; 12; 13; 14; 15; 15; 15]
Thank you in advance
Best Answer