Printing a character n times

36 views (last 30 days)
Jason
Jason on 10 Jun 2020
Answered: madhan ravi on 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

Accepted Answer

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

More Answers (1)

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

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!