How to add zeros in cell of string
Show older comments
Hello, I have 6x1 cell of string
'10'
'00'
'11'
'011'
'0101'
'0100'
how do i change it to
'10000000'
'00000000'
'11000000'
'01100000'
'01010000'
'01000000'
Thanks!
Accepted Answer
More Answers (1)
The MATLAB approach:
C = {'10';'00';'11';'011';'0101';'0100'}
D = compose('%-08s',string(C))
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!