Documentation

Simulink.sdi.clearPreferences

Clear Simulation Data Inspector preference changes

Syntax

Simulink.sdi.clearPreferences

Description

example

Simulink.sdi.clearPreferences reverts all Simulation Data Inspector preferences to their default values.

Examples

collapse all

You can restore default values to all Simulation Data Inspector preferences programmatically with Simulink.sdi.clearPreferences.

Simulink.sdi.clearPreferences

This example shows how to use the Simulation Data Inspector API to modify the Simulation Data Inspector run naming rule, check a run's name, restore default preferences, and check the run naming rule.

% Load model
load_system('sldemo_fuelsys')

% Modify run naming rule
Simulink.sdi.setRunNamingRule('<model_name> Run <run_index>')

% Simulate system
sim('sldemo_fuelsys')

% Check run name
runIDs = Simulink.sdi.getAllRunIDs;
runID = runIDs(end);
run = Simulink.sdi.getRun(runID);
run.name
ans =

    'sldemo_fuelsys Run 9'

% Clear preferences to reset the run naming rule
Simulink.sdi.clearPreferences

% Check run naming rule
Simulink.sdi.getRunNamingRule
ans =

    'Run <run_index>: <model_name>'

Introduced in R2017a

Was this topic helpful?