Unable to import Document Object Model (DOM) API from MATLAB Report Generator

5 vues (au cours des 30 derniers jours)
David Hamilton
David Hamilton le 17 Nov 2015
Commenté : Sean de Wolski le 5 Juil 2017
I am trying to write a script that imports the DOM API from the Matlab Report Generator in order to output data/plots to a Word Document:
import mlreportgen.dom.*;
filename = 'C:\files\test_report';
filetype = 'docx';
report = Document(filename,filetype);
close(report);
This code produces the following error:
Undefined function 'Document' for input arguments of type 'char'.
Error in rpt (line 6)
report = Document(filename,filetype);
I've also tried passing the string equivalents ('C:\files...,'docx') to 'Document' instead of variables and I get the same result.
What could the issue be here? Thanks!

Réponses (1)

Sean de Wolski
Sean de Wolski le 24 Fév 2016
Modifié(e) : Sean de Wolski le 24 Fév 2016
Are you on MATLAB >=R2014b with Report Generator installed and licensed?
ver
license test matlab_report_gen
  2 commentaires
Ishanka M
Ishanka M le 3 Juil 2017
Modifié(e) : Ishanka M le 3 Juil 2017
I have the same problem.
import mlreportgen.dom.*;
myReport = Document('myDoc','html');
Undefined function 'Document' for input arguments of type 'char'.
Also I tested for licensed.
license test matlab_report_gen
ans =
1
I'm using MATLAB2013a
What is the wrong here?
Sean de Wolski
Sean de Wolski le 5 Juil 2017
Ishanka, the DOM API was released in R2014b so you'll need to upgrade to that release or newer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by