Main Content

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.

example

Examples

expand all

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.

Version History

Introduced in R2015a