Modifying sequential filenames with padded numbers
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!