Printing a character n times

30 visualizaciones (últimos 30 días)
Jason
Jason el 10 de Jun. de 2020
Respondida: madhan ravi el 10 de Jun. de 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

Respuesta aceptada

KSSV
KSSV el 10 de Jun. de 2020
Editada: KSSV el 10 de Jun. de 2020
s = repelem('.',1,10) ;
fprintf('%s\n',s)

Más respuestas (1)

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

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by