Creating Variable Output Filename
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I have a script that generates a pdf full of plots.
I would like the output filename *.pdf file to be automatically named according to a variable which contains a date and title
How can I insert a variable filename?
This is the code which saves everything into a pdf:
ps2pdf('psfile', 'myfile.ps', 'pdffile', 'filename.pdf', 'gspapersize', 'a4')
Thanks,
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 30 Jul. 2012
psfilename = sprintf('myfile%s.ps', datestr(TheDate, 'yyyymmdd') );
ps2pdf('psfile', psfilename, 'pdffile', 'filename.pdf', 'gspapersize', 'a4')
3 Kommentare
Walter Roberson
am 31 Jul. 2012
How do you insert raw(3) ? The fact that raw(3) shows quotation marks on output tells us that raw is a cell array, and the third string in it would be accessed by raw{3} rather than raw(3) .
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!