Printing a character n times

41 次查看(过去 30 天)
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

采纳的回答

KSSV
KSSV 2020-6-10
编辑:KSSV 2020-6-10
s = repelem('.',1,10) ;
fprintf('%s\n',s)

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by