Modifying sequential filenames with padded numbers
조회 수: 48 (최근 30일)
이전 댓글 표시
Hello, I am trying to create some file names to save a setr of images and have so far done this:
>> filenames = "clock_" + string(1:8) + ".jpg";
>> filenames'
ans =
8×1 string array
"clock_1.jpg"
"clock_2.jpg"
"clock_3.jpg"
"clock_4.jpg"
"clock_5.jpg"
"clock_6.jpg"
"clock_7.jpg"
"clock_8.jpg"
I'd like to improve on this and have the numers like this:
"clock_001.jpg"
"clock_002.jpg"
"clock_003.jpg"
and to be able to change the starting value. For example, start at 11 would be:
"clock_011.jpg"
"clock_012.jpg"
"clock_013.jpg"
and as a last request I'd like to prefix the current datetime using now()
Thanks
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!