OUtput names same as input names?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Everybody,
I have 150 images as you know each image has name. the output will be 150 image. how to use for loop to save output image with same name of inputs.
Thanks for your help
Reyadh
Akzeptierte Antwort
Jan
am 7 Feb. 2018
As soon as you are able to get the list of input names, it is trivial to use them as output names also. So maybe your question is, how you get the names of the input files? Then see FAQ: Process a sequence of files.
InFolder = 'D:\Your\Folder\';
OutFolder = 'D:\Your\Folder\';
DirList = dir(fullfile(InFolder, '*.jpg'));
for iFile = 1:numel(DirList)
InFile = fullfile(InFolder, DirList(iFile).name);
% Maybe you want to create the output in another folder?
OutFile = fullfile(OuFolder, DirList(iFile).name);
...
end
2 Kommentare
Jan
am 7 Feb. 2018
Exactly what my code does. So what is the actual problem?
Do you want to overwrite the input file or use the same name in a different folder?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type 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!