Main Content

hasChangedFrom

Detect data change from specified value in test step

Description

hasChangedFrom(u,A) returns true if the value of u changes from the value A. Otherwise, hasChangedFrom returns false.

example

Examples

expand all

Detect if x has changed from a value of 15. This statement returns true when x had a value of 15 in the previous time step and has a value not equal to 15 in the current time step.

hasChangedFrom(x,15)

Tips

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

Version History

Introduced in R2015a