image storage with index type 0000
1 次查看(过去 30 天)
显示 更早的评论
Hi, I would like to store a series of images in .bmp format and with an index starting from 0000 for the first image, 0001 for the second and so on.. this is an example of the name of one of the images i want to save : 'ortophoto_0000.bmp' can you give me some advice? thank you
0 个评论
回答(1 个)
KSSV
2022-11-30
编辑:KSSV
2022-11-30
for i = 1:10
name = ['ortophoto_',sprintf('%.4d',i),'.bmp']
end
1 个评论
Les Beckham
2022-11-30
That works but, since you are using sprintf anyway, why not do this?
for i = 1:10
name = sprintf('orthophoto_%04d.bmp', i)
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!