How to create a vector with the same string elements?
54 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
osminbas
il 19 Apr 2012
Modificato: Marco Gomez
il 6 Lug 2023
Hello,
I am trying to create a vector with all the same string elements. When it is numeric, it is as easy as ones(10,1)*5, which gives a vector of "fives". How do you do the same thing with a string, say if I want a vector with all the elements of string 'hi'? Thank you!
0 Commenti
Risposta accettata
Sean de Wolski
il 19 Apr 2012
repmat('hi',[1 5]);
?
Più risposte (1)
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!