Modifying sequential filenames with padded numbers
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!