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 Comments

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

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 28 Aug 2019

Commented:

on 28 Aug 2019

Community Treasure Hunt

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

Start Hunting!