MATLAB Object-Oriented Programming

(Joyce) #1

Name: 'RandNumber'
Description: ''
DetailedDescription: ''
GetAccess: 'public'
SetAccess: 'public'
Dependent: 0
Constant: 0
Abstract: 0
Transient: 0
Hidden: 0
GetObservable: 0
SetObservable: 0
AbortSet: 0
NonCopyable: 0
GetMethod: []
SetMethod: []
HasDefault: 1
DefaultValue: 5
DefiningClass: [1×1 meta.class]


Two of the listed meta.property properties provide information on default values:



  • HasDefault — true (displayed as 1) if the class specifies a default value for the
    property, false if it does not.

  • DefaultValue — Contains the default value, when the class defines a default value
    for the property. If the default value is an expression, the value of DefaultValue is
    the result of evaluating the expression.


For more information on the evaluation of property default values defined by expressions,
see “Evaluation of Expressions in Class Definitions” on page 6-10.


These properties provide a programmatic way to obtain property default values without
opening class definition files. Use these meta.property object properties to obtain
property default values for both built-in classes and classes defined in MATLAB code.


Query Default Value


The procedure for querying a default value involves:


1 Getting the meta.property object for the property whose default value you want to
query.


Find Default Values in Property Metadata
Free download pdf