File created using Matlab File Generator is empty (0 bytes)

8 ビュー (過去 30 日間)
stefan Chytra
stefan Chytra 2021 年 4 月 28 日
コメント済み: stefan Chytra 2021 年 4 月 28 日
Hi,
Its the first time I have used matlab report generator & think I am following the very simple online video but the file I save is empty.
The very simple code I am using is;
import mlreportgen.report.*
R=Report('Simple','pdf')
open("R")
surf(peaks)
add(R,Figure)
Can some please help?
Thankyou
Stefan

採用された回答

Rahul Singhal
Rahul Singhal 2021 年 4 月 28 日
Hi Stefan,
The report content is generated only when the close method is called, which you are missing in your script.
Also, in the open method, you need to pass the Report object (R) and not a string ("R").
-Rahul

その他の回答 (1 件)

Jan
Jan 2021 年 4 月 28 日
編集済み: Jan 2021 年 4 月 28 日
Taken from the documentation:
import mlreportgen.report.*
import mlreportgen.dom.*
R=Report('Simple', 'pdf')
surf(peaks)
add(R, Figure)
close(R);
% Now you can view the report:
rptview(rpt)
I assume, your open("R") opens the empty report directly after the creation.

Community Treasure Hunt

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

Start Hunting!

Translated by