Main Content

Simulink.sdi.setRunNamingRule

Specify the Simulation Data Inspector run naming rule

Description

Simulink.sdi.setRunNamingRule('rule') sets the Simulation Data Inspector rule for naming runs created by simulating a Simulink® model.

example

Examples

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
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>'

Input Arguments

collapse all

Simulation Data Inspector run naming rule for runs created by simulating a Simulink model. The character vector specifying the run naming rule can include plain text and any of the following tokens that represent data pulled from 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.

Example: '<time_stamp> Simulation <run_index>: <model_name>'

Example: '<model_name> - <run_index>'

Alternatives

You can modify the run naming rule using the Simulation Data Inspector UI in the Preferences menu. You can rename a run by modifying the Name property of its Simulink.sdi.Run object.

Version History

Introduced in R2011b