Main Content

sltest.testsequence.getAllScenarios

Get names of all Test Sequence block scenarios

Since R2020b

Description

all_scenarios = sltest.testsequence.getAllScenarios(blockPath) returns the names of all scenarios in a Test Sequence block specified by blockPath.

example

Examples

collapse all

Set the Test Sequence block in the sltestRollRefTestExample model to use scenarios. Add another scenario named new_Scenario. Then, get the names of all scenarios in the Test Sequence block.

openExample('sltestRollRefTestExample');

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

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

all_scenarios = sltest.testsequence.getAllScenarios...
   ('sltestRollRefTestExample/Test Sequence')
all_scenarios =

  1×2 cell array

    {'Scenario_1'}    {'new_Scenario'}

Close the model without saving it.

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'

Output Arguments

collapse all

Names of all scenarios in Test Sequence block, returned as a cell array.

Version History

Introduced in R2020b