Documentation Center

  • Trial Software
  • Product Updates

Contents

Simulink.sdi.close

Close Simulation Data Inspector

Syntax

  • Simulink.sdi.close
  • Simulink.sdi.close(filename) example

Description

Simulink.sdi.close closes the Simulation Data Inspector. It returns an error if there is unsaved data.

example

Simulink.sdi.close(filename) closes the Simulation Data Inspector and saves the data in the specified filename.

Examples

expand all

Close Simulation Data Inspector and Save Data

Log data, simulate a model, view the results, close the Simulation Data Inspector, and save the data.

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

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

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

% Close the Simulation Data Inspector and save the data
Simulink.sdi.close('savedData.mat');

The data file, savedData.mat, is saved in the current working directory.

Input Arguments

expand all

filename — Filename to save datastring (default)

Filename to save data, specified as a string. The string must fully specify the target file to save.

Was this topic helpful?