Contents

Simulink.sdi.view

Open Simulation Data Inspector

Syntax

Simulink.sdi.view

Description

Simulink.sdi.view opens the Simulation Data Inspector.

Examples

Create a run in the Simulation Data Inspector and open the tool to view the simulation output.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample', 'SaveOutput','on', ...
             'SaveFormat', 'StructureWithTime', ...
             'ReturnWorkspaceOutputs', 'on');

% Create a run in the Simulation Data Inspector
runID = Simulink.sdi.createRun('My Run','base',{'simOut'});

% See the results in Simulation Data Inspector
Simulink.sdi.view;

Compare two runs and open the tool to view the comparison.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample', 'SaveOutput','on',...
             'SaveFormat', 'StructureWithTime',...
             'ReturnWorkspaceOutputs', 'on');

% Create a run in the Simulation Data Inspector and get signal IDs
run1ID = Simulink.sdi.createRun('My Run', 'namevalue',...
                                {'simOut'}, {simOut});

% Change one of the parameters of the model
Mq = 3*Mq;

% Simulate again
simOut = sim('slexAircraftExample', 'SaveOutput','on',...
             'SaveFormat', 'StructureWithTime',...
             'ReturnWorkspaceOutputs', 'on');

% Create another another run get signal IDs
run2ID = Simulink.sdi.createRun('New Run', 'namevalue',...
                                 {'simOut'}, {simOut});

% Define alignment algorithms
algorithms = [Simulink.sdi.AlignType.DataSource
              Simulink.sdi.AlignType.BlockPath
              Simulink.sdi.AlignType.SID];

% Compare the two runs
difference = Simulink.sdi.compareRuns(run1ID, run2ID, algorithms);

% See the results in Simulation Data Inspector in the Comparisons pane
Simulink.sdi.view(Simulink.sdi.GUITabType.CompareRuns);

Alternatives

To open the Simulation Data Inspector, from the Simulink® Editor toolbar, click the Simulation Data Inspector button.

Was this topic helpful?