slreportgen.report.LookupTable Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Lookup table block reporter
Description
Creation
Description
creates an
empty rptr = LookupTableLookupTable block reporter based on a default template.
Use its properties to specify the lookup table block on which to report and
specify report options.
creates a rptr = LookupTable(lutobj)LookupTable block reporter for the lookup table
block specified by lutobj. By default, the reporter
generates a table and a plot of output values versus breakpoints, and a data
types table.
sets rptr = LookupTable(Name=Value)LookupTable reporter properties using name-value arguments.
You can specify multiple name-value arguments in any order.
Input Arguments
See the Object property.
Properties
Lookup table block to report on, specified as the path or handle of the block.
These lookup table blocks are supported.
Note
If you use a finder to find a Lookup Table block and add it directly
to a report, this LookupTable reporter is used rather
than a Simulink object property reporter.
Whether to include a table of lookup table data, specified as a logical.
If true, the report includes a table that lists output
values and breakpoints of the lookup table.
For a 1-D lookup table, the data table lists the breakpoints in the first column of the table. The second column lists the corresponding output values.
For a 2-D or greater dimension lookup table, the data table lists the
first set of breakpoints in the first row of the table. It lists the second
set of breakpoints in the first column. The output appears in the
corresponding table cells. For lookup tables greater than 2-D, the
LookupTable report generator shows slices of the table as
separate output versus breakpoint tables.
Whether to include a lookup table data plot, specified as a logical. If
true, the report includes a plot of the output values
versus the breakpoints of the lookup table block.
For a 1-D lookup table, the plot is a line plot of output values versus breakpoints.
For 2-D tables and slices, the plot is a surface or mesh plot of output
values versus breakpoints. Use the PlotType property to
specify whether to use a surface or mesh plot.
Plot type for a 2-D lookup table data plot, specified as either a character array ('Surface Plot' or 'Mesh Plot') or string ("Surface Plot" or "Mesh Plot").
Lookup table data reporter, specified as a BaseTable
reporter or custom reporter. The LookupTable reporter uses
the specified reporter to create a table of lookup table data.
To customize the appearance of the table of lookup table data, customize
the default BaseTable reporter or replace it with a custom
version of the BaseTable reporter.
To customize the title of the table of lookup table data, specify the
contents in the Title property of the default or
replacement reporter. The content you specify is placed at the front of the
default title. If the lookup table is too wide to fit legibly on a page, use
the MaxCols property of the
DataReporter to generate the table as a set of
slices that fit legibly. To determine an optimal value, iterate setting the
MaxCols value and viewing the report.
Example: lutable.DataReporter.Title = 'New
Title'
Lookup table data plot reporter, specified as a Figure
reporter or custom reporter. The LookupTable reporter uses
the specified reporter to create a plot of output values versus breakpoints
of the lookup table.
To customize the appearance of the plot of the lookup table data,
customize the default Figure reporter or replace it with a
custom version of the Figure reporter. To customize the
caption of the plot, specify the contents in the
Caption property of the default or replacement
reporter. The content you specify is placed at the front of the default
caption.
Maximum number of table columns to display for the output values versus
breakpoints, specified as inf or an integer. This
property applies only if the IncludeTable property is
true.
If the number of lookup table columns is greater than the value of this
property, the data is shown only as a surface plot. The plot appears only if
the IncludePlot property is true.
The default value of this property is inf, which causes
the reporter to use a table regardless of the size of the lookup table data
array. Depending on the size of the data being displayed, some tables can be
illegible. To avoid creation of illegible tables, change the default setting
of this property to a smaller value.
Source of the template for this reporter, specified in one of these ways:
Character vector or string scalar that specifies the path of the file that contains the template for this reporter
Reporter or report whose template this reporter uses or whose template library contains the template for this reporter
Document Object Model (DOM) document or document part whose template this reporter uses or whose template library contains the template for this reporter
The specified template must be the same type as the report to which you
append this reporter. For example, for a Microsoft® Word report, TemplateSrc must be a Word reporter template.
If the TemplateSrc property is empty, this reporter uses the
default reporter template for the output type of the report.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Name of the template for this reporter, specified as a character vector or string scalar.
The template for this reporter must be in the template library of the template specified by
the TemplateSrc property of this reporter.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: char | string
Hyperlink target for this reporter, specified as a character vector or string scalar
that specifies the link target ID, or an mlreportgen.dom.LinkTarget object. A character vector or string scalar
value converts to a LinkTarget object. The link target immediately
precedes the content of this reporter in the output report.
Attributes:
GetAccess | public |
SetAccess | public |
Methods
slreportgen.report.LookupTable.createTemplate | Create Simulink lookup table block reporter template |
slreportgen.report.LookupTable.customizeReporter | Create custom LookupTable reporter class |
slreportgen.report.LookupTable.getClassFolder | Lookup Table reporter class definition file location |
copy | Create copy of a Simulink reporter object and make deep copies of certain property values |
getImpl | Get implementation of reporter |
Examples
This example shows how to add fixed content to a customized
HTML LookupTable reporter template. You can also customize your
lookup table report output by editing the report generator program directly. The
advantage of customizing a template is that you can reuse it as a basis for
customizing another report generator program.
The template and style sheets for the LookupTable reporter are
located in the
matlab\toolbox\shared\slreportgen\rpt\rpt\+slreportgen\+report\@LookupTable\resources\templates
folder. You do not need to specify this path when you copy the default
template.
Create a copy of the default html template. In this example, the template
package is saved as a zipped file named
CustomTemplate.htmtx in the current working
folder.
import mlreportgen.report.* import slreportgen.report.* LookupTable.createTemplate('CustomTemplate','html');
Unzip the template package.
unzipTemplate('CustomTemplate.htmtx');CustomTemplate and is saved in the current working
folder. The root.css file, which is in the
stylesheets subfolder, defines the styles that
control the appearance and formatting of the generated report. The
docpart_templates.html file specifies the holes that
hold the report contents when the report is generated.From the CustomTemplate folder, open the
docpart_templates.html file in a text editor outside
of MATLAB®.
<html>
<head>
<meta charset="utf-8" />
<title>Document Part Templates</title>
<link rel="StyleSheet" href="./stylesheets/root.css" type="text/css" />
</head> <body>
<dplibrary>
<!-- NOTE: temporary in the template library until the -->
<! DOM supports a source without template name -->
<dptemplate name="LookupTable">
<hole id="Content">LUT_CONTENT</hole>
<hole id="LUTDataTypes">DATA_TYPE</hole>
<hole id="FootNoteContent">LUT_FOOTNOTE_CONTENT</hole>
</dptemplate>
<dptemplate name="LookupTableContent">
<hole id="TableContent">TABLECONTENT</hole>
<hole id="FigureContent">FIGURECONTENT</hole>
</dptemplate>
</dplibrary>
</body>
</html>To add fixed text to the template, place it in the desired location and
use standard HTML tagging. This example adds text that appears above the
data types table in the generated report. Only the <dptemplate
name="LookupTable"> portion of the file is
shown.
<dptemplate name="LookupTable"> <hole id="Content">LUT_CONTENT</hole> <p><scan>This lookup table block contains the following data types:</scan></p> <hole id="LUTDataTypes">DATA_TYPE</hole> <hole id="FootNoteContent">LUT_FOOTNOTE_CONTENT</hole> </dptemplate>
Save the file.
At the MATLAB command line, zip the template folder into a template package.
For this example, the template package is zipped to the
CustomTemplate.htmtx
file.
zipTemplate('CustomTemplate');To use the saved template for your report, specify the template source in your report generator program.
lutable = LookupTable();
lutable.TemplateSrc = 'CustomTemplate';Create a PDF report generator that specifies the plot height and width returned by the LookupTable reporter. This example uses the sf_car model and reports on its Torque ratio Lookup Table (n-D) block. This block is a 1-D lookup table and is in the transmission/Torque Converter subsystem of the sf_car model. To set the height and width of the plot, use the PlotReporter property.
import slreportgen.report.* import mlreportgen.report.* model_name = "sf_car"; load_system(model_name); lutable = "sf_car/transmission/Torque Converter/Torque ratio"; rpt = slreportgen.report.Report("output","pdf"); chapter = Chapter(lutable); rptr = LookupTable(lutable); rptr.IncludeTable = false; add(chapter,rptr); rptr_resized = LookupTable(lutable); rptr_resized.IncludeTable = false; rptr_resized.PlotReporter.Snapshot.Width = "3in"; rptr_resized.PlotReporter.Snapshot.Height = "4in"; add(chapter,rptr_resized); add(rpt,chapter); close(rpt) ; close_system(model_name) rptview(rpt);
The default plot on the first page of the report uses predefined sizing to fit the plot to the page size.

The resized plot on the second page of the report uses the specified 3" width and 4" height.

Create a PDF report generator that reports on a lookup table block. This example uses the sf_car model and reports on its engine torque Lookup Table (n-D) block. This block is a 2-D lookup table. The engine torque block is in the Engine subsystem of the sf_car model. The report, by default, includes a table of output values versus breakpoints, a surface plot, a table of block data types, and notes about possible differences between reported values and values obtained from simulation.
import slreportgen.report.* import mlreportgen.report.* model_name = "sf_car"; load_system(model_name); lutable = "sf_car/Engine/engine torque"; rpt = slreportgen.report.Report('output','pdf'); chapter = Chapter(lutable); rptr = LookupTable(lutable); add(chapter,rptr); add(rpt,chapter); close(rpt); close_system(model_name); rptview(rpt)


This example shows how to create a PDF report generator that finds the blocks in the Engine subsystem of the sf_car model. The report generator program then loops through the blocks, identifies lookup table blocks, and uses the LookupTable reporter to report information on those blocks. For other blocks, the generated report reports on block properties by using the BlockFinder class.
import slreportgen.report.* import slreportgen.finder.* import mlreportgen.report.* model_name = "sf_car"; load_system(model_name) subsys_name = "sf_car/Engine"; rpt = Report; blkfinder = BlockFinder(subsys_name); blks = find(blkfinder); for i=1:length(blks) if slreportgen.utils.isLookupTable(blks(i).Object) rptr = LookupTable(blks(i).Object); ch = Chapter(blks(i).Name); add(ch,rptr); add(rpt,ch); else ch = Chapter(blks(i).Name); add(ch,blks(i)); add(rpt,ch); end end close(rpt); rptview(rpt); close_system(model_name);
The first chapter shows the parameters for the Inport block.

The fifth chapter shows the output for a Lookup Table block reporter. The default output is a table of output values versus breakpoints, a plot, and a table of data types.


Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)