Main Content

Simulink.sdi.clearPreferences

Restore Simulation Data Inspector preferences to default settings

Description

example

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

You can configure these preferences in the Simulation Data Inspector programmatically:

Examples

collapse all

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

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);
fuelRun = Simulink.sdi.getRun(runID);
fuelRun.name
ans = 
'sldemo_fuelsys Run 1'
% 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