댓글 수: 6

What is the result when you run the following in your command window?
which mlreportgen.dom.Document
What happens when you don't try to use a custom template? Can you successfully run this example?
import mlreportgen.dom.*;
d = Document('mydoc','docx');
append(d,'Hello World');
close(d);
rptview(d.OutputPath);
Hi, it works!
so, it means that i can't use a custom template? =(
Thanks!
Sorry, I don't know what happened but I can't see your last reply again. But you mentioned that it could be the syntax, however I was guided by a mathworks tutorial on generating reports.
maybe, is my Matlab version? 2020a
Sorry, i realized I was wrong so removed it. This link is helpful.

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

 채택된 답변

Cris LaPierre
Cris LaPierre 2021년 2월 15일

0 개 추천

With the documentation example working, try using your template again. Do you still get the same error?
If so, how did you create your template? What happens if you create your template using

댓글 수: 2

Hi, it works fine now! thanks a lot. So, i suppose that i have to create the document with code as a first step, rigth?
Cris LaPierre
Cris LaPierre 2021년 2월 15일
편집: Cris LaPierre 2021년 2월 15일
I just worked through the example in the video you shared, and it worked fine for me. Perhaps you just needed to restart MATLAB?

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

추가 답변 (1개)

Rahul Singhal
Rahul Singhal 2021년 2월 15일
The issue in the non-working script is that it has a typo in the package import statement, which is the reason it is not able to recognize the Document class.
Change:
import mireportgen.dom.*;
to
import mlreportgen.dom.*;

카테고리

제품

릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by