필터 지우기
필터 지우기

programmatically define save location of reports generated through mlreportgen.dom

조회 수: 12 (최근 30일)
i'm figuring out how to programmatically generate reports with matlab, I've got a finished product for one of the experiments I run. I am using mlreportgen.dom
The current save location is at
C:/Users/AppData/Local/Temp/mlreportgen
how can I programmatically define that location in matlab? I've changed the output path as shown in here
https://www.mathworks.com/help/rptgen/ug/mlreportgen.dom.document-class.html
but that only changes were the .htmx file saves, which is no good.

답변 (1개)

Wilson A N
Wilson A N 2018년 6월 22일
Hi Mattj,
I was able to use the 'OutputPath' parameter given in the mlreportgen.dom for saving the output files in .pdf, .html, .docx into the specified outpath path. I modified the same example given in the documentation page you had listed. The modified code is given below:
import mlreportgen.dom.*;
d = Document('mydoc','pdf');
d.OutputPath = 'E:\Workspace\Newpath.pdf'
append(d,'Hello World');
close(d);
rptview(d.OutputPath);
Can you provide a sample code so that I can check it out at my end.
  댓글 수: 1
Gwendolyn Williams
Gwendolyn Williams 2024년 3월 6일
I realize it's been awhile since anyone touched this thread, but just in case anyone else needed to know:
Yes, using d.OutputPath works to set the output path for the report.
I used a report (rpt = Report('reportname','pdf'), and it worked beautifully.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Report Generator Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by