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.view

Open the Simulation Data Inspector

Syntax

Simulink.sdi.view

Description

example

Simulink.sdi.view opens the Simulation Data Inspector.

Examples

collapse all

Create a run and open the Simulation Data Inspector to view it.

% 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 in the Simulation Data Inspector.

% 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});

% Get and change one of the model parameters in the model workspace
mws = get_param('slexAircraftExample','modelworkspace');
wsMq = mws.evalin('Mq');
mws.assignin('Mq',3*wsMq);

% 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 .

Introduced in R2011b

Was this topic helpful?