strcat help

4 次查看(过去 30 天)
James
James 2011-8-19
filename=strcat('frame',num2str(i),'.jpg')
This line is within a for loop so images are created with filenames...
frame1, frame2...frame50
How can I change this line of code so that it is... frame001, frame002 ... frame050

采纳的回答

Jan
Jan 2011-8-20
filename = sprintf('frame%03d.jpg', i)

更多回答(2 个)

Walter Roberson
Walter Roberson 2011-8-19

Micky Elias
Micky Elias 2020-5-19
filename=strcat(num2str(img,'%04i'),'.jpg');

标签

Community Treasure Hunt

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

Start Hunting!

Translated by