Main Content

sltest.testsequence.setScenarioControlSource

Set source controlling Test Sequence active scenario

Description

example

sltest.testsequence.setScenarioControlSource(blockPath,scenarioControlSource) sets the source, specified by scenarioControlSource, that controls the active scenario for the Test Sequence block specified by blockPath.

Examples

collapse all

Set the Test Sequence block in the sltestRollRefTestExample model to use scenarios. Set the source that controls the active scenario for the Test Sequence block in the sltestRollRefTestModel to the workspace. Close the model without saving it.

Model = 'sltestRollRefTestExample';
load_system(Model);

sltest.testsequence.useScenario...
   ('sltestRollRefTestExample/Test Sequence',...
   'Scenario_1');

sltest.testsequence.activateScenario...
   ('sltestRollRefTestExample/Test Sequence',...
   'Scenario_1');

sltest.testsequence.setScenarioControlSource...
   ('sltestRollRefTestExample/Test Sequence',...
    sltest.testsequence.ScenarioControlSource.Workspace);

close_system(Model,0)

Input Arguments

collapse all

Path to a Test Sequence block, including the block name, specified as a string or character vector.

Example: 'FanSpeedTestHarness/Test Sequence'

Active scenario control source, specified as either of these enumerated values:

  • sltest.testsequence.ScenarioControlSource.Block — The active scenario is controlled by setting it in the Test Sequence block.

  • sltest.testsequence.ScenarioControlSource.Workspace — The active scenario is controlled by a workspace variable that specifies the index of the active scenario. The variable can be in the base workspace, model workspace, or data dictionary.

Introduced in R2020b