How to save a figure with three - digit numbers or Time Stamps in folder
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
a.s
am 19 Jul. 2020
Kommentiert: Star Strider
am 4 Aug. 2020
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 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Jul. 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 Kommentare
Star Strider
am 4 Aug. 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!