Printing a character n times

40 vues (au cours des 30 derniers jours)
Jason
Jason le 10 Juin 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

Réponse acceptée

KSSV
KSSV le 10 Juin 2020
Modifié(e) : KSSV le 10 Juin 2020
s = repelem('.',1,10) ;
fprintf('%s\n',s)

Plus de réponses (1)

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

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by