how create cell array of blank space " "

1 次查看(过去 30 天)
cell(1,5)
ans = 1×5 cell array
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}

采纳的回答

Voss
Voss 2023-9-5
Cell array:
C = repmat({' '},1,5)
C = 1×5 cell array
{' '} {' '} {' '} {' '} {' '}
or:
C = cell(1,5);
C(:) = {' '}
C = 1×5 cell array
{' '} {' '} {' '} {' '} {' '}
A string array may be useful too:
S = repmat(" ",1,5)
S = 1×5 string array
" " " " " " " " " "
or:
S = strings(1,5);
S(:) = " "
S = 1×5 string array
" " " " " " " " " "

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by