Hello everyone,
I have a cell (390×1) and it should repeat the words 'hello, 'hey', 'hi' and 'hoi' every 4 rows, as in the following:
Row 1 – 'hello'; Row 2 – 'hey'; Row 3 – 'hi'; Row 4 – 'hoi'; Row 5 – 'hello'; Row 6 – 'hey'; Row 7 – 'hi'; Row 8 – 'hoi'.
However, sometimes it goes like:
Row 9 – 'hello'
Row 10 – 'hey'
Row 11 – 'hoi'
And it skips the 'hi' row, making it so that I can't loop it using something like "for i = 1:4:390", which is what I need.
What I want to do is create the same cell where the "3rd row" of every "4 rows" is empty, that is: when the 3rd row has "hi" in it, those 4 rows stay the same. But when the "hi" row is missing, it creates an empty cell row between the 2nd and the 4th row (between the 'hey' and the 'hoi').
For example, it would be come:
Row 9 – 'hello'
Row 10 – 'hey'
Row 11 – ' ' (empty)
Row 12 'hoi'
I already tried doing this with loops and the strcmp function, but I really can't do it.
Please ask questions in case I didn't explain myself well enough.
Thank you
Best Answer