create a string like "AA";"BB";"CC";"DD", and so on
11 次查看(过去 30 天)
显示 更早的评论
Hi! I would like to create a string like "AA";"BB";"CC";"DD",and so on.
The idea is similar to this:
letters_str = string(mat2cell('A':'Z',1,ones(1,26)))';
I would simply like to double the letters in 'letters_str'.
0 个评论
采纳的回答
Dyuman Joshi
2023-9-24
str = string(char('AA' + repmat((0:25)',1,2)))
1 个评论
Dyuman Joshi
2023-9-24
Another idea -
str = string(('A':'Z')');
str = join([str str],'')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!