Create string of dots characters
2 views (last 30 days)
Show older comments
Hi,
I want to create a string of dots character like the function blanks does to create spaces. how do I do that?
0 Comments
Accepted Answer
More Answers (1)
David Sanchez
on 7 Jan 2014
function my_dots(n)
str = '';
for k=1:n
str = strcat(str,'.');
end
disp(str)
>> my_dots(3)
...
>> my_dots(10)
..........
1 Comment
Jos (10584)
on 7 Jan 2014
In every iteration, str grows by one element, making this painstakingly slow with increasing n … MLint warns you for this problem.
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!