Save images every certain period

1 回表示 (過去 30 日間)
Andres Bayona
Andres Bayona 2019 年 1 月 31 日
コメント済み: Andres Bayona 2019 年 1 月 31 日
Hello
I'm running a script in Matlab, which gives me a lot of images (hundreds). I need to save them and name them parallel to the execution of the script, but I do not want all the images saved, but for example: image 10, image 20, image 30, etc.
How can I name them? I want figure one to be "00001", figure 2 "00002" and so on.
How can I save them in a specific folder?
Thank you.

回答 (1 件)

Ollie A
Ollie A 2019 年 1 月 31 日
for imagenumber = 1:1000
if mod(imagenumber,10)==0 % Modulo
filename = sprintf('Image%d.png',imagenumber);
imwrite(Image(imagenumber), filename)
end
end
This might work, but it's a shot in the dark because I can't see your code.
  1 件のコメント
Andres Bayona
Andres Bayona 2019 年 1 月 31 日
I'm going to try it.
Thank you very much.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by