Package: slreportgen.report
Superclasses:
MATLAB Function block or Stateflow MATLAB function reporter
Create a MATLAB Function block or Stateflow® MATLAB® function reporter.
Note
To use a MATLABFunction
reporter in a report, you must create the
report using the slreportgen.report.Report
class.
creates an empty
reporter
= MATLABFunction()MATLABFunction
reporter based on a default template. Use its
properties to specify the Simulink®
MATLAB Function block or a Stateflow
MATLAB function on which to report and specify report options.
creates a reporter
= MATLABFunction(mlfcnobj
)MATLABFunction
reporter for the specified
mlfcnobj
. This reporter adds this default information to the
generated report:
Simulink MATLAB Function block properties or Stateflow MATLAB function properties, depending on whether the MATLAB function is a block or object
Function input and output argument summary
MATLAB code used by the MATLAB function to compute its outputs from its inputs
Use the reporter properties to include other information, such as detailed argument properties, function symbol properties, and supporting functions information.
sets reporter
= MATLABFunction(Name,Value
)MATLABFunction
reporter properties using name-value pairs. You can
specify multiple name-value pair arguments in any order. Enclose each property name in
single or double quotes.
createTemplate | Create MATLAB Function reporter template |
customizeReporter | Create custom MATLAB Function reporter class |
getClassFolder | MATLAB Function reporter class definition file location |
Create a PDF report generator that uses the MATLABFunction
reporter. This reporter includes information about the MATLAB
Function block in the sldemo_radar_eml
model.. The
report, by default, includes a table of object properties, a table of input and
output arguments, and the function script.
import slreportgen.report.* import mlreportgen.report.* model_name = 'sldemo_radar_eml'; load_system(model_name); mlfcnobj = 'sldemo_radar_eml/MATLAB Function'; rpt = slreportgen.report.Report('output','pdf'); chapter = Chapter(mlfcnobj); rptr = MATLABFunction(mlfcnobj); add(chapter,rptr); add(rpt,chapter); close(rpt); close_system(model_name); rptview(rpt);
The first page of the generated report is shown.
Create an HTML report generator that uses the MATLABFunction
reporter and includes MATLAB Function argument details. Use the
IncludeArgumentProperties
property to include a table for
each MATLAB Function block input and output argument. This example
uses the sldemo_radar_eml
model.
import slreportgen.report.* import mlreportgen.report.* model_name = 'sldemo_radar_eml'; load_system(model_name); mlfcnobj = 'sldemo_radar_eml/MATLAB Function'; rpt = slreportgen.report.Report('output','html'); chapter = Chapter(mlfcnobj); rptr = MATLABFunction(mlfcnobj); rptr.IncludeArgumentProperties = true; add(chapter,rptr); add(rpt,chapter); close(rpt); close_system(model_name); rptview(rpt);
This portion of the generated report shows some of the argument detail tables.
Create an HTML report generator that uses the MATLABFunction
reporter and sets the appearance of the function script and title. Change the
appearance of the MATLAB Function block function script section of
the report. Use the FunctionScriptTitle
property to specify the
text to add at the front of the default function script table title. Create and use
a DOM paragraph to change the font, font size, and color of the script. This example
uses the sldemo_radar_eml
model.
import slreportgen.report.* import mlreportgen.report.* model_name = 'sldemo_radar_eml'; load_system(model_name); mlfcnobj = 'sldemo_radar_eml/MATLAB Function'; rpt = slreportgen.report.Report('output','html'); chapter = Chapter(mlfcnobj); rptr = MATLABFunction(mlfcnobj); paraTitle = mlreportgen.dom.Paragraph('SCRIPT: '); rptr.FunctionScriptTitle = paraTitle; paraScript = mlreportgen.dom.Paragraph; paraScript.FontFamilyName = 'Arial'; paraScript.FontSize = '12pt'; paraScript.Color = 'blue'; rptr.FunctionScript = paraScript; add(chapter,rptr); add(rpt,chapter); close(rpt); close_system(model_name); rptview(rpt);
This section of the generated report shows "SCRIPT:" added to the title and 12pt Arial blue font.
MATLAB Function | mlreportgen.dom.Paragraph
| mlreportgen.report.BaseTable
| slreportgen.finder.BlockFinder
| slreportgen.finder.BlockResult
| slreportgen.finder.DiagramElementFinder
| slreportgen.finder.DiagramElementResult
| slreportgen.finder.StateflowDiagramElementFinder
| slreportgen.utils.isMATLABFunction