Action when tunable properties change
processTunedPropertiesImpl(obj) specifies the actions to perform when one or more tunable property values change. This method is called as part of the next call to the step method after a tunable property value changes. A property is tunable only if its Nontunable attribute is false, which is the default.
processTunedPropertiesImpl is called by the step method.
Note: You must set Access = protected for this method.
You cannot modify any tunable properties in this method if its System object will be used in the Simulink® MATLAB System block.
Use this method when a tunable property affects a different property value. For example, two property values determine when to calculate a lookup table. You want to perform that calculation when either property changes. You also want the calculation to be done only once if both properties change before the next call to the step method.
Use processTunedPropertiesIempl to recalculate the lookup table if the value of either the NumNotes or MiddleC property changes.
methods (Access = protected) function processTunedPropertiesImpl(obj) % Generate a lookup table of note frequencies obj.pLookupTable = obj.MiddleC * (1+log(1:obj.NumNotes)/log(12)); end end