Newbie Question about MATLAB Report Generator

4 ビュー (過去 30 日間)
Kevin
Kevin 2021 年 11 月 12 日
コメント済み: Kevin 2021 年 11 月 12 日
Hi everyone,
I am learning how to MATLAB Report Generator to generate PDF file. I am following the magic squares example in the documentation.
Once I have the variable "rpt", I have tried to generate PDF file using this command:
report(rpt)
Q1: The above command always generates the PDF in the current folder. How do I change the folder?
Q2: If I delete the PDF file and run the above command a second time, it does not generate the PDF file. Is this expected.
Thanks

回答 (1 件)

Kevin
Kevin 2021 年 11 月 12 日
After playing around with my matlab script a bit more, then I realize that my original question doesn not make sense.
It turns out that it is these lines that will create the pdf file (maybe 0 byte).
rpt = mlreportgen.report.Report([mfilename('fullpath'), '.pdf']);
tp = mlreportgen.report.TitlePage;
tp.Title = 'Magic Squares';
tp.Subtitle = 'Columns, Rows, Diagonals: All Equal Sums';
tp.Author = 'Albrecht Durer';
append(rpt,tp);
Then it is the line that creates the final PDF file
close(rpt)
Am I correct?
  2 件のコメント
Sean de Wolski
Sean de Wolski 2021 年 11 月 12 日
That looks right to me. I'd encourage you to look at the task examples:
Kevin
Kevin 2021 年 11 月 12 日
Hi Sean,
Thank you very much. The link is very useful.
Kevin

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeReport Generator Creation についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by