Create string of dots characters
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I want to create a string of dots character like the function blanks does to create spaces. how do I do that?
댓글 수: 0
채택된 답변
추가 답변 (1개)
David Sanchez
2014년 1월 7일
function my_dots(n)
str = '';
for k=1:n
str = strcat(str,'.');
end
disp(str)
>> my_dots(3)
...
>> my_dots(10)
..........
댓글 수: 1
Jos (10584)
2014년 1월 7일
In every iteration, str grows by one element, making this painstakingly slow with increasing n … MLint warns you for this problem.
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!