| Contents | Index |
Simulink.sdi.report()
Simulink.sdi.report(Name,Value)
Simulink.sdi.report() creates a report of the current view and data in the Inspect Signals tab in the Simulation Data Inspector.
Simulink.sdi.report(Name,Value) creates a report using the parameter Name, Value pairs, which specifies the information to include in the report.
Specify optional comma-separated pairs of Name,Value arguments, where 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.
'ReportToCreate' |
Specify which Simulation Data Inspector tab view to include in the report
Default: 'Inspect Signals' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'ReportOutputFolder' |
MATLAB string specifying the location of the generated report. Default: <current working folder>/slprj/sdi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'ReportOutputFile' |
MATLAB string specifying the report file name. Default: 'SDI_report.html' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'PreventOverwritingFile' |
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'ColumnsToReport' |
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 Compare Signals report, create a variable signal_metadata: signal_metadata = [Simulink.sdi.SignalMetaData.Run, Simulink.sdi.SignalMetaData.SyncMethod]; Table Columns available for Inspect Signals and Compare Signals tabs:
Table columns available for the Compare Run tab:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'ShortenBlockPath' |
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'LaunchReport' |
Boolean value. If the value is true after creation, the generated report opens. Default: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'SignalsToReport' |
For the 'Compare Runs' view only.
Default: 'ReportOnlyMismatchedSignals' |
Create a report from the Inspect Signals view
% Configure model "sldemo_f14" for logging and simulate
simOut = sim('sldemo_f14', '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 Inspect Signals view
Simulink.sdi.report();Create a report from the Compare Signals view
% Configure model "sldemo_f14" for logging and simulate
simOut = sim('sldemo_f14', 'SaveOutput','on', ...
'SaveFormat', 'StructureWithTime', ...
'ReturnWorkspaceOutputs', 'on');
% Create a Data Inspector run
[~, ~, signalIDs] = Simulink.sdi.createRun('My Run', 'base', {'simOut'});
% Compare two signals
Simulink.sdi.compareSignals( signalIDs(1), signalIDs(2) );
% Report on the signal comparison
Simulink.sdi.report('ReportToCreate', 'Compare Signals', ...
'ReportOutputFolder', tempdir, 'ReportOutputFile', 'myReport.html');Create a report from the Compare Runs view
% Configure model "sldemo_f14" for logging and simulate
set_param('sldemo_f14/Pilot','WaveForm','square');
simOut = sim('sldemo_f14', '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('sldemo_f14/Pilot','WaveForm','sawtooth');
simOut = sim('sldemo_f14', '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.RelTol1];
% Report on the run comparison
Simulink.sdi.report('ReportToCreate', 'Compare Runs', ...
'ColumnsToReport', metaDataOfInterest, ...
'SignalsToReport', 'ReportAllSignals' );
In the Simulation Data Inspector tool, to generate a report, select File > Generate Report.
Simulink.sdi.compareRuns | Simulink.sdi.compareSignals | Simulink.sdi.createRun

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |