Main Content

sltest.testsequence.setScenarioControlSource

Set source controlling Test Sequence active scenario

Since R2020b

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.

openExample('sltestRollRefTestExample');

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. Instead of the block path, you can use a block handle.

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.

Version History

Introduced in R2020b