Main Content

isInactivePropertyImpl

Class: matlab.System

Status of inactive property

Syntax

flag = isInactivePropertyImpl(obj,prop)

Description

flag = isInactivePropertyImpl(obj,prop) specifies whether a public, non-state property is inactive and not visible for the current object configuration. An inactive property is a property that is not relevant to the object because of 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.

Run-Time Details

isInactiveProperty is called by disp, get and set methods.

Method Authoring Tips

You must set Access = protected for this method.

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If your isInactivePropertyImpl method does not use the object, you can replace this input with ~.

Public, non-state property name

Output Arguments

expand all

Inactive status Indicator of the input property prop for the current object configuration.

Examples

expand all

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

Version History

Introduced in R2012b