How to save Figures using "print" with a filename from a variable?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ezgi Kurt
am 10 Aug. 2019
Kommentiert: Ezgi Kurt
am 10 Aug. 2019
Hi,
I am currently using below code to save a sequence of figures. This format allows me to sequence the figures as figCI_1 and figCI_2 etc.
for k=1:length(figs)
print(figs(k), '-dpng', sprintf('/Users/Figure3/figCI_%d.png', k))
end
However, I want to add further details to the figure's saving name, such as figCI_1_1980, figCI_1_1981 etc.
Is there a way to specify these extra variables somewhere in the code above?
Note: If I change the k variable to years, then I lose the 1,2,3 sequence. So, I need to find a way to include a bunch of different (possibly string and nonstring indicators) in my graph title. Is there an easy way for this?
Thank you so much!
0 Kommentare
Akzeptierte Antwort
the cyclist
am 10 Aug. 2019
It's a straightforward extension of what you are doing now. For example
k = 1;
y = 1989;
sprintf('/Users/Figure3/figCI_%d_%d.png', k,y)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps 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!