hasChangedTo

Detect data change to specified value in test step

Description

hasChangedTo(u,B) returns true if the value of u changes to the value B. Otherwise, hasChangedTo returns false.

Examples

Detect Value Change To Specified Value

Detect if x has changed to a value of 10. This statement returns true when x did not have value of 10 in the previous time step and has a value of 10 in the current time step.

hasChangedTo(x,10)

Tips

hasChangedTo statements can be used in the Test Sequence and Test Assessment blocks and in Stateflow® charts.

Introduced in R2015a