Is there a function to do this?
이전 댓글 표시
답변 (3개)
There is no need to manipulate the format string, it is much simpler to use the '*' option:
>> sprintf('%0*d',4,12)
ans = 0012
Fangjun Jiang
2018년 1월 8일
With this, will you be able to work out the function?
>> sprintf('%04d',12)
ans =
'0012'
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!