Place string in front of vector
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I have a vector of numbers: num = [1:16]; I would like to place the character: 'B' in front of each number i that vector without using the for loop.
Are there any tricks to do this quickly?
The result should look like this:
[B1 B2 B3 B4........]
thanks.
1 Commento
Risposta accettata
Più risposte (1)
Azzi Abdelmalek
il 26 Ott 2012
Modificato: Azzi Abdelmalek
il 26 Ott 2012
[ '[' sprintf('B%d ',1:16) ']']
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!