Main Content

sltest.testsequence.editTransition

Edit test sequence step transition

Description

sltest.testsequence.editTransition(blockPath,stepPath,index,Name,Value) edits transition index in stepPath of the Test Sequence block blockPath. Transition properties are specified by Name,Value.

Examples

collapse all

This example adds a transition to a test step, then changes the transition's index, condition, and next step of the first transition in the step.

1. Load the model.

Model = 'sltestRollRefTestExample';
load_system(Model);

2. Add a transition to the step AttitudeLevels.APEngage.LowRoll. The transition destination is the step AttitudeLevels.APEngage_End.

sltest.testsequence.addTransition('sltestRollRefTestExample/Test Sequence',...
'AttitudeLevels.APEngage_LowRoll','TurnKnob ~= 0',...
'AttitudeLevels.APEngagement_End')

3. Edit the transition index, condition, and next step of the first transition.

sltest.testsequence.editTransition('sltestRollRefTestExample/Test Sequence',...
'AttitudeLevels.APEngage_LowRoll',1,'Index',2,...
'NextStep','AttitudeLevels.APEngage_HighRoll',...
'Condition','duration(DD_PhiRef == 0,sec) >= 5')

4. Close the model.

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'

Path of the step in the Test Sequence block, specified as a character vector. The path includes the step location in the Test Sequence hierarchy, using . to separate hierarchy levels. If the Test Sequence block is using scenarios, add the scenario name that contains the step to the beginning of the step path, for example, Scenario_2.SystemHeatingTest.InitializeHeating.

Example: 'SystemHeatingTest.InitializeHeating'

Integer specifying the transition in the test step to be edited. Corresponds to the integer displayed in the Transition cell of the Test Sequence Editor.

Example: 3

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Condition','error == 1','NextStep','Stop','Index', 3

The condition on which the transition executes, specified as a character vector. To execute the transition, enter a valid logical expression.

Example: 'theta == 0 && a == 1'

The name of the destination step of the transition, which is next in the sequence if the transition condition is satisfied.

Example: 'RampAngle'

Integer specifying the new transition index to be applied

Example: 'Index',2

Version History

Introduced in R2017a