Value changed callback, specified as one of these values:
A function handle.
A cell array in which the first element is a function
handle. Subsequent elements in the cell array are the arguments to
pass to the callback function.
A character vector containing a valid MATLAB expression (not recommended). MATLAB evaluates this expression in the base workspace.
This callback executes when the user selects or clears the check box in the app. The
callback does not execute if the check box value changes programmatically.
This callback function can access specific information about the user’s interaction
with the check box. MATLAB passes this information in a ValueChangedData
object as the second argument to your callback function.
In App Designer, the argument is called event
. You can query the
object properties using dot notation. For example,
event.PreviousValue
returns the previous value of the check box.
The ValueChangedData
object is not available to
callback functions specified as character vectors.
The following table lists the properties of the ValueChangedData
object.
Property | Value |
---|
Value | Value of check box after most recent app user interaction with
it. |
PreviousValue | Value of check box before most recent app user interaction with
it. |
Source | Component that executes the callback. |
EventName | 'ValueChanged' |
For more information about writing callbacks, see Write Callbacks in App Designer.