Main Content


Get the Simulation Data Inspector rule for naming runs



namingRule = Simulink.sdi.getRunNamingRule returns the run naming rule as a character vector. The run naming rule can contain one or more tokens that update for each run, for example, <run_index>. The run naming rule applies to runs automatically created through simulating a model in Simulink®.


collapse all

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

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

% Simulate system

% Check run name
runIDs = Simulink.sdi.getAllRunIDs;
runID = runIDs(end);
fuelRun = Simulink.sdi.getRun(runID);
ans = 
'sldemo_fuelsys Run 1'
% Clear preferences to reset the run naming rule

% Check run naming rule
ans = 
'Run <run_index>: <model_name>'

Output Arguments

collapse all

Character vector that specifies the naming rule the Simulation Data Inspector uses to name the runs automatically created through simulating a Simulink model. The run naming rule can contain any of the following tokens that represent information pulled for each run:

  • <run_index> – Run's index in the Simulation Data Inspector repository.

  • <model_name> – Name of the model simulated to create the run.

  • <time_stamp> – Start time for the simulation that created the run.

  • <sim_mode> – Simulation mode used for the simulation that created the run.


You can view the run naming rule using the Simulation Data Inspector UI. You can find the New Run options under the Simulation Data Inspector Preferences menu.

Version History

Introduced in R2015a