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

 Réponse acceptée

Jan
Jan le 20 Août 2011

0 votes

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

Plus de réponses (2)

Micky Elias
Micky Elias le 19 Mai 2020

0 votes

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

1 commentaire

Walter Roberson
Walter Roberson le 19 Mai 2020
%03i not %04i for the user question.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by