different file name in saving images
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Turbulence Analysis
il 27 Apr 2022
Commentato: Walter Roberson
il 3 Nov 2024
In the below script, based on iteration numbers in for loop, I need to change Y_10, Y_20,Y_30,Y_40.....Y_100
Is there a way to achive this instead of renaming everytime ??
saveas(gcf, sprintf('Y_10mm'), 'bmp')
savefig(gcf, sprintf('Y_10mm')
0 Commenti
Risposta accettata
DGM
il 27 Apr 2022
Modificato: DGM
il 27 Apr 2022
In whatever loop you're using, create the filename something like this:
k = 10 % whatever number you need
sprintf('Y_%03dmm.bmp',k)
Unless you have a need to avoid it, zero-pad your numbers so that your files sort correctly and are easier to read back in corresponding order
6 Commenti
Walter Roberson
il 3 Nov 2024
for h = [10 20 30]
for w = [20 21 22]
filename = sprintf('Y_%03dmm_x_%03dmm.bmp',h,w);
%some calculation
imwrite(YourImage, filename);
end
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!