Add 9 rows after every row in a table

Hello, I have a (43400,39) table. For every row I'd like to enter 9 copies of that row beneath.
e.g.
1111
2222
turns into
1111
1111
1111
1111
1111
1111
1111
1111
1111
1111
2222
2222
etc.
I've attempted to use the 'insertrows' function shown here, but I'm not really competant enough to interpret it at all/for my needs https://uk.mathworks.com/matlabcentral/fileexchange/9984-insertrows
My script is currently as follows:
T = readtable('filename.xlsx', 'Sheet', 'RawData');
Many thanks, Fraje

2 commentaires

Johannes Fischer
Johannes Fischer le 28 Août 2019
I'm pretty sure repelem does exactly what you are looking for.
Fraje Watson
Fraje Watson le 28 Août 2019
Brilliant - that's perfect and simple enough for me to understand :)
T = readtable('filename.xlsx', 'Sheet', 'RawData');
T2 = repelem(T,10,1);

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Question posée :

le 28 Août 2019

Commenté :

le 28 Août 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by