Printing a character n times

17 Ansichten (letzte 30 Tage)
Jason
Jason am 10 Jun. 2020
Beantwortet: madhan ravi am 10 Jun. 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

Akzeptierte Antwort

KSSV
KSSV am 10 Jun. 2020
Bearbeitet: KSSV am 10 Jun. 2020
s = repelem('.',1,10) ;
fprintf('%s\n',s)

Weitere Antworten (1)

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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by