I want to increase my cell's length by 8 times, by making each and every element copying by 8 times.

1 回表示 (過去 30 日間)
If i have a cell of size 2*1 containing 2 elements cat and dog. Now I want to increase my cell size by 16*1, by making my 1st 8 elements as cat and next 8 elements as dog. If anyone could help me solve it by loops or any other means, it would be a great help. Thanks !!!!

採用された回答

Stephen23
Stephen23 2021 年 9 月 27 日
C = {'cat','dog'};
D = repelem(C,8)
D = 1×16 cell array
{'cat'} {'cat'} {'cat'} {'cat'} {'cat'} {'cat'} {'cat'} {'cat'} {'dog'} {'dog'} {'dog'} {'dog'} {'dog'} {'dog'} {'dog'} {'dog'}

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by