how to save images in a for loop?

3 次查看(过去 30 天)
hey, I wrote a code to save a few images in a for loop in a cirtin folder,it won't work,please help
for beta=-1:1
...
...
...
xx=sprintf('C:\Users\Sagipc\Desktop\ImageLibrary\beta%g.jpg',beta);
imwrite(pic1,xx,'jpg');
end

采纳的回答

Star Strider
Star Strider 2014-9-9
Simply stating the problem as ‘it won’t work’ doesn’t tell us much.
It looks as though it’s writing ‘pic1’ to every file you create. I would assume you intend a different result.
What are your image file names? How would you want to save them?
  5 个评论
Sagi
Sagi 2014-9-9
that was very helpful, thank u heaps!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by