Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Simulink.sdi.report

Generate a Simulation Data Inspector report

Syntax

Simulink.sdi.report
Simulink.sdi.report(Name,Value)

Description

example

Simulink.sdi.report creates a report of the default column set and plotted data in the Inspect pane in the Simulation Data Inspector.

example

Simulink.sdi.report(Name,Value) uses additional options specified by one or more Name,Value pair arguments to generate a report of the specified view and plotted data in the Simulation Data Inspector.

Examples

collapse all

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on', ...
             'SaveFormat','StructureWithTime', ...
             'ReturnWorkspaceOutputs','on');
  
% Create a Data Inspector run
[~,~,signalIDs] = Simulink.sdi.createRun('My Run','base',{'simOut'});
  
% Select signals for plotting
for i = 1:length(signalIDs)
   signal = Simulink.sdi.getSignal(signalIDs(i));
   signal.checked = true;
end
  
% Create default report, which is the Runs pane view
Simulink.sdi.report;
% Configure model "slexAircraftExample" for logging and simulate
set_param('slexAircraftExample/Pilot','WaveForm','square');
simOut = sim('slexAircraftExample','SaveOutput','on', ...
                  'SaveFormat','StructureWithTime', ...
                  'ReturnWorkspaceOutputs','on');

% Create a Simulation Data Inspector run, Simulink.sdi.Run, from 
% simOut in the base workspace
runID1 = Simulink.sdi.createRun('First Run','namevalue',{'simOut'},{simOut});

% Simulate again
set_param('slexAircraftExample/Pilot','WaveForm','sawtooth');
simOut = sim('slexAircraftExample','SaveOutput','on', ...
             'SaveFormat','StructureWithTime', ...
             'ReturnWorkspaceOutputs','on');
      
% Create another Simulation Data Inspector run
runID2 = Simulink.sdi.createRun('Second Run','namevalue',{'simOut'},{simOut});

% Compare two runs
difference = Simulink.sdi.compareRuns(runID1,runID2);

% Specify columns to include in the report
metaDataOfInterest = [Simulink.sdi.SignalMetaData.Result, ...
                    Simulink.sdi.SignalMetaData.BlockPath1, ...
                    Simulink.sdi.SignalMetaData.RelTol];
% Report on the run comparison
Simulink.sdi.report('ReportToCreate','Compare Runs', ...
                    'ColumnsToReport',metaDataOfInterest, ...
                    'SignalsToReport','ReportAllSignals');

Input Arguments

collapse all

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'ColumnsToReport','SignalName'

collapse all

Simulation Data Inspector pane and plots to include in the report, specified as the comma-separated pair consisting of 'ReportToCreate' and one of these values:

  • 'Inspect Signals' — Information in the Inspect pane.

  • 'Compare Runs' — Information in the Compare pane.

Example: 'ReportToCreate','Inspect Signals'

collapse all

Location of the generated report, specified as the comma-separated pair consisting of 'ReportOutputFolder' and a character vector.

collapse all

Report file name, specified as the comma-separated pair consisting of 'ReportOutputFile' and a character vector.

Report overwrite prevention, specified as the comma-separated pair consisting of 'PreventOverwritingFile' and one of the Boolean true or false values. If the report file exists and the value is true, then the report generator increments the file name. If false, the report generator overwrites the report file, if it exists.

Signal and run metadata column specifier, specified as the comma-separated pair consisting of 'ColumnsToReport' and an array of column enumerations.

Array specifying values from the enumeration class, Simulink.sdi.SignalMetaData, which lists all signal metadata available in the Simulation Data Inspector. For example, to include the Run and Synchronization Method pane columns in a report, create an array signal_metadata.

signal_metadata = [Simulink.sdi.SignalMetaData.Run, Simulink.sdi.SignalMetaData.SyncMethod];
Specify the array as the value in the comma-separated pair.
Simulink.sdi.report('ColumnsToReport',signal_metadata);

Table columns available for theInspect Signals report:

Column ValueDescription
SignalName (default)Signal name
Line (default)Signal line style and color
SIDSignal ID
UnitsSignal measurement units
SigDataTypeSignal data type
SigSampleTimeMethod used to sample the signal
ModelName of the model that generated the signal
BlockNameName of the source block for the signal
BlockPathPath to the source block for the signal
PortIndex of the signal on the output port of its block
DimensionsDimensions of the matrix containing the signal
ChannelIndex of signal within matrix
RunName of the simulation run containing the signal
AbsTolUser-specified, positive-valued absolute tolerance for the signal
RelTolUser-specified, positive-valued relative tolerance for the signal
OverrideGlobalTolUser-specified property that determines whether signal tolerances take priority over global tolerances
TimeTolUser-specified, positive-valued time tolerance for the signal
InterpMethodUser-specified interpolation method
SyncMethodUser-specified synchronization method used to coordinate signals for comparison
TimeSeriesRootName of the variable associated with the signal for signals imported from the MATLAB® workspace
TimeSourceName of the array containing the time data for signals imported from the MATLAB workspace
DataSourceName of the array containing the signal data for signals imported from the MATLAB workspace

Table columns available for the Compare Runs report:

Column ValueDescription
Result (default)Pass/fail result of the signal comparison between the Baseline and Compare To runs
Line1Line style and color for the Baseline signal
Line2Line style and color for the Compare To signal
AbsTol (default)User-specified, positive-valued absolute tolerance for the Baseline signal
RelTol (default)User-specified, positive-valued relative tolerance for the Baseline signal
MaxDifferenceThe maximum difference between the Baseline and Compare To signals
OverrideGlobalTolUser-specified property that specifies whether the Baseline signal tolerances take priority over global tolerances
TimeTolUser-specified, positive-valued time tolerance for the Baseline signal
SignalName1Signal name from the Baseline run
SignalName2Signal name from the Compare To run
Units1Measurement units for the signal in the Baseline run
Units2Measurement units for the signal in the Compare To run
SigDataType1The data type for the signal in the Baseline run
SigDataType2The data type for the signal in the Compare To run
SigSampleTime1Method used to sample the signal in the Baseline run
SigSampleTime2Method used to sample the signal in the Compare To run
Run1Name of the Baseline run
Run2Name of the Compare To run
AlignedBy (default)Signal alignment method used to correlate Baseline and Compare To signals
Model1Name of the model that generated the Baseline signals
Model2Name of the model that generated the Compare To signals
BlockName1Name of the source block for the Baseline signal
BlockName2Name of the source block for the Compare To signal
BlockPath1Path to the source block for the Baseline signal
BlockPath2Path to the source block for the Compare To signal
Port1Index of the Baseline signal on the output port of its block
Port2Index of the Compare To signal on the output port of its block
Dimensions1Dimensions of the matrix containing the Baseline signal
Dimensions2Dimensions of the matrix containing the Compare To signal
Channel1Index of the Baseline within its matrix
Channel2Index of the Compare To within its matrix
InterpMethodUser-specified interpolation method for the Baseline signal
SyncMethodUser-specified synchronization method for the Baseline signal
TimeSeriesRoot1Name of the variable associated with the Baseline signal for signals imported from the MATLAB workspace
TimeSeriesRoot2Name of the variable associated with the Compare To signal for signals imported from the MATLAB workspace
TimeSource1Name of the array containing the Baseline time data for signals imported from the MATLAB workspace
TimeSource2Name of the array containing the Compare To time data for signals imported from the MATLAB workspace
DataSource1Name of the array containing the Baseline signal data for signals imported from the MATLAB workspace
DataSource2Name of the array containing the Compare To signal data for signals imported from the MATLAB workspace
LinkToPlot (default)Link to a plot of each comparison result

Block path name length, specified as the comma-separated pair consisting of 'ShortenBlockPath' and one of the Boolean true or false values. If the value is true and the block path name is too long, the Simulation Data Inspector shortens the name in the report. If the value is false, then the report displays the entire block path name.

Launch report after creation, specified as the comma-separated pair consisting of 'LaunchReport' and one of the Boolean true or false values. If the value is true after creation, the generated report opens.

For the Compare pane report only. Comparison signals set, specified as the comma-separated pair consisting of 'SignalsToReport' and one of these values:

  • 'ReportOnlyMismatchedSignals' — Include only the mismatched signals from the comparison between the Baseline and Compare To runs.

  • 'ReportAllSignals' — Include all signals from the comparison between the Baseline and Compare To runs.

Alternatives

In the Simulation Data Inspector, click Create Report. For more information, see Create A Simulation Data Inspector Report.

Introduced in R2011b

Was this topic helpful?