Printing a character n times

16 visualizzazioni (ultimi 30 giorni)
Jason
Jason il 10 Giu 2020
Risposto: madhan ravi il 10 Giu 2020
Is it possible to print a '.' (i.e..a dot) n times without using a loop?
I have a loop that waits for a response and I want the number of dots to be printed indicating what number loop its in
Thanks
Jason

Risposta accettata

KSSV
KSSV il 10 Giu 2020
Modificato: KSSV il 10 Giu 2020
s = repelem('.',1,10) ;
fprintf('%s\n',s)

Più risposte (1)

madhan ravi
madhan ravi il 10 Giu 2020
n = 5; % number of times
join(repmat(".",5,1))

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by