Generate a sequence/vector of randomized letters
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to create a 1x10 row vector of randomized letters.
My code so far is:
a='A':'Z';
letters= a(randi(numel(a), 1, 10))
I was wondering if I could have this sequence output in a way where each letter is spaced with a comma in between. Ex: Instead of 'ABCDE', I would like'A, B, C, D, E'. Thank you to whoever can help! (Note: I am quite new to MATLAB)
0 Commenti
Risposta accettata
KSSV
il 17 Ago 2022
a='A':'Z';
letters= a(randi(numel(a), 1, 10))
iwant = strjoin(cellstr(letters'),',')
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Report Generator 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!