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 日

0 投票

filename = sprintf('frame%03d.jpg', i)

その他の回答 (2 件)

Micky Elias
Micky Elias 2020 年 5 月 19 日

0 投票

filename=strcat(num2str(img,'%04i'),'.jpg');

1 件のコメント

Walter Roberson
Walter Roberson 2020 年 5 月 19 日
%03i not %04i for the user question.

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

タグ

質問済み:

2011 年 8 月 19 日

コメント済み:

2020 年 5 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by