Simulink.sdi.setRunNamingRule - Specify the Simulation Data Inspector run naming rule - MATLAB (original) (raw)
Main Content
Specify the Simulation Data Inspector run naming rule
Syntax
Description
Simulink.sdi.setRunNamingRule(['rule'](#d126e535385))
sets the Simulation Data Inspector rule for naming runs created by simulating a Simulink® model.
Examples
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(' Run ')
% 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 : '
Input Arguments
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 thePreferences menu. You can rename a run by modifying theName
property of its Simulink.sdi.Run object.
Version History
Introduced in R2011b