How do you pad every other element of a cell array with a blank value thereby doubling the length of the cell?

 採用された回答

Voss
Voss 2022 年 11 月 28 日

0 投票

Maybe something like this:
C = {1 2 3 4};
C_new = cell(1,2*numel(C));
C_new(1:2:end) = C
C_new = 1×8 cell array
{[1]} {0×0 double} {[2]} {0×0 double} {[3]} {0×0 double} {[4]} {0×0 double}

その他の回答 (0 件)

カテゴリ

製品

リリース

R2021b

質問済み:

2022 年 11 月 28 日

回答済み:

2022 年 11 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by