Documentation

processTunedPropertiesImpl

Class: matlab.System
Package: matlab

Action when tunable properties change

Syntax

processTunedPropertiesImpl(obj)

Description

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.

Tips

Use this method when a tunable property affects the value of a different property.

To check if a property has changed since stepImpl was last called, use isChangedProperty within processTunedPropertiesImpl.

Input Arguments

obj

System object™

Examples

collapse all

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 step method. propChange indicates if either property has changed.

methods (Access = protected)
   function processTunedPropertiesImpl(obj)
      propChange = isChangedProperty(obj,obj.NumNotes) ||...
         isChangedProperty(obj,obj.MiddleC)
      if propChange
         obj.pLookupTable = obj.MiddleC * (1+log(1:obj.NumNotes)/log(12));
      end
    end
end
Was this topic helpful?