Documentation

isInactivePropertyImpl

Class: matlab.System
Package: matlab

Inactive property status

Syntax

flag = isInactivePropertyImpl(obj,prop)

Description

flag = isInactivePropertyImpl(obj,prop) specifies whether a public, non-state property is inactive for the current object configuration. An inactive property is a property that is not relevant to the object, given the values of other properties. Inactive properties are not shown if you use the disp method to display object properties. If you attempt to use public access to directly access or use get or set on an inactive property, a warning occurs.

isInactiveProperty is called by the disp method and by the get and set methods.

    Note:   You must set Access = protected for this method.

Input Arguments

obj

System object™ handle

prop

Public, non-state property name

Output Arguments

flag

Inactive status Indicator of the input property prop for the current object configuration, returned as a logical scalar value

Examples

collapse all

Specify When a Property Is Inactive

Display the InitialValue property only when the UseRandomInitialValue property value is false.

methods (Access = protected)
  function flag = isInactivePropertyImpl(obj,propertyName)
    if strcmp(propertyName,'InitialValue')
      flag = obj.UseRandomInitialValue;
    else
      flag = false;
    end
  end
end
Was this topic helpful?