フィルターのクリア

Dynamically write images in different names?

1 回表示 (過去 30 日間)
Niranjan
Niranjan 2011 年 2 月 20 日
Hello all, I've got a small problem. I want to write a image file for every iteration but in different names. The condition is explained below
for i=1:n
imwrite(x:x+h,y:y+w,'file01.jpg');
end I want to save the file name as file01.jpg,file02.jpg and so on.The name must dynamically vary with each iteration .How can I do that?? Any help?

採用された回答

Jan
Jan 2011 年 2 月 20 日
Beside the NUM2STR suggested in the FAQ, SPRINTF is fine also:
for i=1:n
imwrite(x:x+h,y:y+w, sprintf('file%.02d.jpg', i));
end
It is suggested in general to read the FAQ and the Getting Started chapters in the documentation before asking here.

その他の回答 (1 件)

David Young
David Young 2011 年 2 月 20 日
See "How can I process a sequence of files?" at http://matlab.wikia.com/wiki/FAQ

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by