How to use %s

8 次查看(过去 30 天)
Emanuele Mele
Emanuele Mele 2018-12-21
回答: madhan ravi 2018-12-21
Hi all!
I would like to avoid saving the file with the .tif in the name when I use %s during a loop
Here is the code I'm using
baseFileName = tifFiles(j).name;
saveas(gcf,sprintf('%s(%d) .jpeg',baseFileName, j));
Result
input x.tif ---> save x.tif(number).jpeg
what i want is
input x.tif ---> save x.jpeg
thank you!

采纳的回答

madhan ravi
madhan ravi 2018-12-21
saveas(gcf,sprintf('x%d.jpeg',j));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by