# 16進数の連番が格納​されたcellを作る​方法を教えてください​。

12 views (last 30 days)
K_S_ on 13 Sep 2022
Edited: K_S_ on 13 Sep 2022

datalist = {
'0000FFFF'
'0008FFFF'
'0016FFFF'
'0024FFFF'
'0032FFFF'
...
'1000FFFF'
}

Hernia Baby on 13 Sep 2022
Edited: Hernia Baby on 13 Sep 2022
composeで実現可能です
num = (1:1000)';
datalist = compose('%04dFFFF',num)
datalist = 1000×1 cell array
{'0001FFFF'} {'0002FFFF'} {'0003FFFF'} {'0004FFFF'} {'0005FFFF'} {'0006FFFF'} {'0007FFFF'} {'0008FFFF'} {'0009FFFF'} {'0010FFFF'} {'0011FFFF'} {'0012FFFF'} {'0013FFFF'} {'0014FFFF'} {'0015FFFF'} {'0016FFFF'} {'0017FFFF'} {'0018FFFF'} {'0019FFFF'} {'0020FFFF'} {'0021FFFF'} {'0022FFFF'} {'0023FFFF'} {'0024FFFF'} {'0025FFFF'} {'0026FFFF'} {'0027FFFF'} {'0028FFFF'} {'0029FFFF'} {'0030FFFF'}

sprintfcを使います
clear
num = {1:1000}';
datalist = (sprintfc("%04dFFFF",vertcat(num{:})))'
datalist = 1000×1 cell array
{'0001FFFF'} {'0002FFFF'} {'0003FFFF'} {'0004FFFF'} {'0005FFFF'} {'0006FFFF'} {'0007FFFF'} {'0008FFFF'} {'0009FFFF'} {'0010FFFF'} {'0011FFFF'} {'0012FFFF'} {'0013FFFF'} {'0014FFFF'} {'0015FFFF'} {'0016FFFF'} {'0017FFFF'} {'0018FFFF'} {'0019FFFF'} {'0020FFFF'} {'0021FFFF'} {'0022FFFF'} {'0023FFFF'} {'0024FFFF'} {'0025FFFF'} {'0026FFFF'} {'0027FFFF'} {'0028FFFF'} {'0029FFFF'} {'0030FFFF'}
K_S_ on 13 Sep 2022
Edited: K_S_ on 13 Sep 2022
ご回答いただきありがとうございました。

### Categories

Find more on System Composer in Help Center and File Exchange

R2022a

### Community Treasure Hunt

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

Start Hunting!