Documentation

isInactivePropertyImpl

Class: matlab.System
Package: matlab

Active or inactive flag for properties

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

Logical scalar value indicating whether the input property prop is inactive for the current object configuration.

Examples

expand all

Set Inactive Property

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?