Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to save an image into direct folder with increment filename using imwrite()?

3 ビュー (過去 30 日間)
Alvindra Pratama
Alvindra Pratama 2016 年 6 月 14 日
閉鎖済み: Stephen23 2016 年 6 月 14 日
i'm new in matlab and i have a problem that i can't solve it like this. Here my new code :
folder = 'H:\SKRIPSI\Citra Latih 2\';
ImageFiles = dir(folder);
a = length(ImageFiles)-1;
for Index = 1:a
baseFileName = [num2str(Index),'.jpg'];
imwrite(img.cdata,fullfile(folder,baseFileName));
end
the code above can save images in increment filename like 1.jpg, 2.jpg, 3.jpg and so on but still overwrite the previous images with the new images. What is worng with my code? can you help me to fix it?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by