How to use %s

조회 수: 17 (최근 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에서 Performance and Memory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by