create a string like "AA";"BB";"CC";"DD", and so on
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Alberto Acri
il 24 Set 2023
Commentato: Dyuman Joshi
il 24 Set 2023
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 Commenti
Risposta accettata
Dyuman Joshi
il 24 Set 2023
str = string(char('AA' + repmat((0:25)',1,2)))
1 Commento
Dyuman Joshi
il 24 Set 2023
Another idea -
str = string(('A':'Z')');
str = join([str str],'')
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!