Main Content

sltest.testsequence.addScenario

Add new scenario to Test Sequence block

Since R2020b

Description

sltest.testsequence.addScenario(blockPath,scenarioName) adds a new scenario with the name specified by scenarioName to the Test Sequence block specified by blockPath. The specified Test Sequence block must be in scenario mode and the name of the new scenario cannot already exist in the block. The new scenario is added after the last scenario in the block.

example

Examples

collapse all

Set the Test Sequence block in the sltestRollRefTestExample model to use scenarios. Then, add a new scenario named new_Scenario. Close the model without saving it.

openExample('sltestRollRefTestExample');

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

sltest.testsequence.addScenario...
   ('sltestRollRefTestExample/Test Sequence',...
   'new_Scenario');

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'

Name of the scenario, specified as a string or character vector.

Example: 'Name','Scenario_1'

Version History

Introduced in R2020b