How do I go about saving a "published" output as a different name each consecutive time its created?

6 ビュー (過去 30 日間)
Golnar
Golnar 2014 年 3 月 22 日
回答済み: Jan 2014 年 3 月 22 日
I have a code that uses the 'publish' prompt to output a PDF, I'd like this PDF to be called a different name each time, and have these PDFs saved in a directory (database).

回答 (2 件)

Jan
Jan 2014 年 3 月 22 日
You can rename the created file:
mydoc = publish('YourFile.m', 'pdf');
[folder, name] = fileparts(mydoc);
movefile(mydoc, fullfile(folder, [name, datestr(now,0), '.pdf']);

per isakson
per isakson 2014 年 3 月 22 日
編集済み: per isakson 2014 年 3 月 22 日
Different names of the output file is not supported (AFAIK), but you can put it in different subfolders. Doc says:
For example, to specify the PDF output format and the output folder
C:\myPublishedOutput, use:
options = struct('format','pdf','outputDir','C:\myPublishedOutput')

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by