How to save a figure with three - digit numbers or Time Stamps in folder
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I want to save a figure of video in a folder (this frame grab on which color recognition processing has been done and frame name is img1.) and then order to besorted in the same folder in terms of order - digit numbers or Time Stamps.I already apologize that my english is not strong enough .
imwrite(img1,'orginimage.png');
for k=1:10;
img =img1;
baseFileName = sprintf('G:\abcd\rafe evejaj\pic%03d.png', k);
fullFileName = fullfile(baseFileName);
imwrite(img, fullFileName);
end
__________________________________________________________________---
> Error using imwrite (line 433)
Unable to determine the file format from the file name.
> Error in lkjhgfd2 (line 183)
imwrite(img, fullFileName);
0 Commenti
Risposta accettata
Star Strider
il 19 Lug 2020
In order to print a backslant (\) character using sprintf (or its friends), it is necessary to ‘escape’ it by preceding it with a backslant character.
Try this:
baseFileName = sprintf('G:\\abcd\\rafe evejaj\\pic%03d.png', k);
.
6 Commenti
Star Strider
il 4 Ago 2020
I am not certain what the problem actually is.
One option is to include a date (and time) or other uniquely identifying information along with the serial identification number. That simply requires an additional field in the sprintf format string, and that the additional information be supplied as an argument to the sprintf call.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!