matlab.System.processTunedPropertiesImpl - Action when tunable properties change - MATLAB (original) (raw)
Main Content
Class: matlab.System
Action when tunable properties change
Syntax
processTunedPropertiesImpl(obj)
Description
processTunedPropertiesImpl([obj](#bs4on59-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8))
specifies the algorithm to perform when one or more tunable property values change. This method is called as part of the next call to the System object™ after a tunable property value changes. A property is tunable only if itsNontunable
attribute is false
, which is the default.
Run-Time Details
processTunedPropertiesImpl
is called when you run the System object.
In MATLAB® when multiple tunable properties are changed before running the System object, processTunedPropertiesImpl
is called only once for all the changes. isChangedProperty
returns true
for all the changed properties.
In Simulink®, when a parameter is changed in a MATLAB System (Simulink) block dialog, the next simulation step callsprocessTunedPropertiesImpl
before calling stepImpl
. All tunable parameters are considered changed andprocessTunedPropertiesImpl
method is called for each of them.isChangedProperty
returns true
for all the dialog properties.
For details, see Detailed Call Sequence.
Method Authoring Tips
- You must set
Access = protected
for this method. - Use this method when a tunable property affects the value of a different property.
- If the System object will be used in the SimulinkMATLAB System (Simulink) block, you cannot modify any tunable properties in this method.
- To check if a property has changed since
stepImpl
was last called, useisChangedProperty
withinprocessTunedPropertiesImpl
. See Specify Action When Tunable Property Changes for an example.
Input Arguments
obj
— System object
System object
System object handle used to access properties, states, and methods specific to the object. If your processTunedPropertiesImpl
method does not use the object, you can replace this input with ~
.
Examples
Specify Action When Tunable Property Changes
Use processTunedPropertiesImpl
to recalculate the lookup table if the value of either the NumNotes
or MiddleC
property changes before the next call to the System object. propChange
indicates if either property has changed.
methods (Access = protected) function processTunedPropertiesImpl(obj) propChange = isChangedProperty(obj,'NumNotes') ||... isChangedProperty(obj,'MiddleC') if propChange obj.pLookupTable = obj.MiddleC * (1+log(1:obj.NumNotes)/log(12)); end end end
Version History
Introduced in R2013b