Generate report from Simulation Data Inspector tool


Description creates a report of the current view and data in the Runs pane in the Simulation Data Inspector.,Value) creates a report using the parameter Name, Value pairs, which specifies the information to include in the report.

Input Arguments

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.


Specify which Simulation Data Inspector pane to include in the report

'Inspect Signals' (default)Information in the Runs pane
'Compare Runs'Information in the Comparisons pane

Default: 'Inspect Signals'


MATLAB string specifying the location of the generated report.

Default: <current working folder>/slprj/sdi


MATLAB string specifying the report file name.

Default: 'SDI_report.html'


Boolean value. 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.

Default: true


Matrix 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 columns in the Comparisons pane report, create a variable signal_metadata:

signal_metadata = [Simulink.sdi.SignalMetaData.Run, Simulink.sdi.SignalMetaData.SyncMethod];

Table Columns available for the Runs pane:

Enumeration ElementTable Column Description
BlockPath (default)Block path
SignalName (default)Signal Name
Line (default)Line style
AbsTol (default)Positive number (user-specified)
RelTol (default)Positive number (user-specified)
SyncMethodMethod to align time vector: union, intersection, uniform (user-specified)
DataSourceString signifying the source of data (logsout.Stick.Data)
TimeSeriesRootString signifying the name of the Simulink.Timeseries object (logsout.Stick.Time)
TimeSourceString signifying the array containing the time data (logsout.Stick.Time)
InterpMethodMethod to align data: zoh, linear (user-specified)
PortIndex of the output port that emits the signal logged
DimensionsNumber of dimensions of the signal
ChannelChannel of matrix data
RunName of a simulation run
ModelModel name for the signal data

Table columns available for the Comparisons pane:

Result (default)Result of the comparison for the signal across the specified runs
AbsTol (default)Absolute tolerance
RelTol (default)Relative tolerance
AlignedBy (default)Metadata used to align signal data between simulation runs
LinkToPlot (default)Link to a plot of each comparison result
BlockPath1Block path for signal from first run
BlockPath2Block path for signal from second run
SignalNameSignal name from first run
DataSource1Name for the data from first run
DataSource2Name for the data from second run
SyncMethodSynchronization method specified for the first run
InterpMethodInterpolation method specified for the first run
Channel1Channel specified for the first run
Channel2Channel specified for the second run


Boolean value. 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, the entire block path name is displayed in the report.

Default: true


Boolean value. If the value is true after creation, the generated report opens.

Default: true


For the 'Compare Runs' view only.

'ReportOnlyMismatchedSignals'Includes only the mismatched signals from comparing two runs
'ReportAllSignals'Includes all signals in the two compared runs

Default: 'ReportOnlyMismatchedSignals'


Create a report from the Runs pane

% 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;
% Create default report, which is the Runs pane view;

Create a report from the Comparisons pane view

% Configure model "slexAircraftExample" for logging and simulate
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
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, ...
% Report on the run comparison'ReportToCreate', 'Compare Runs', ...
                    'ColumnsToReport', metaDataOfInterest, ...
                    'SignalsToReport', 'ReportAllSignals' );


In the Simulation Data Inspector, to generate a report, click Create Report on the Visualize or Compare tab. For more information, see Create Simulation Data Inspector Report.

Was this topic helpful?