Main Content

sltest.testsequence.deleteScenario

Delete scenario from Test Sequence block

Since R2020b

Description

sltest.testsequence.deleteScenario(blockPath,scenarioName) removes the scenario specified by scenarioName from the Test Sequence block specified by blockPath. All steps in the deleted scenario are also deleted. Each scenario in a Test Sequence block is identified by a scenario name and an index. When you delete a scenario, the indices of the following scenarios update. For example, if you delete the second scenario, the index of the third scenario changes from 3 to 2.

example

Examples

collapse all

Set the Test Sequence block in the sltestRollRefTestExample model to use scenarios. Add a new scenario named Scenario_2, and then delete the scenario.

openExample('sltestRollRefTestExample');

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

sltest.testsequence.deleteScenario...
   ('sltestRollRefTestExample/Test Sequence',...
   'Scenario_2');

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